MCPcopy
hub / github.com/pallets/click / Hinted

Class Hinted

tests/test_termui.py:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57def test_progressbar_length_hint(runner, monkeypatch):
58 class Hinted:
59 def __init__(self, n):
60 self.items = list(range(n))
61
62 def __length_hint__(self):
63 return len(self.items)
64
65 def __iter__(self):
66 return self
67
68 def __next__(self):
69 if self.items:
70 return self.items.pop()
71 else:
72 raise StopIteration
73
74 next = __next__
75
76 @click.command()
77 def cli():

Callers 1

cliFunction · 0.85

Calls

no outgoing calls

Tested by 1

cliFunction · 0.68