MCPcopy Index your code
hub / github.com/python/cpython / StopNow

Class StopNow

Lib/test/test_itertools.py:54–59  ·  view source on GitHub ↗

Class emulating an empty iterable.

Source from the content-addressed store, hash-verified

52 yield i
53
54class StopNow:
55 'Class emulating an empty iterable.'
56 def __iter__(self):
57 return self
58 def __next__(self):
59 raise StopIteration
60
61def take(n, seq):
62 'Convenience function for partially consuming a long of infinite iterable'

Callers 1

test_StopIterationMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_StopIterationMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…