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

Class BasicIterClass

Lib/test/test_iter.py:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29# Helper classes
30
31class BasicIterClass:
32 def __init__(self, n):
33 self.n = n
34 self.i = 0
35 def __next__(self):
36 res = self.i
37 if res >= self.n:
38 raise StopIteration
39 self.i = res + 1
40 return res
41 def __iter__(self):
42 return self
43
44class IteratingSequenceClass:
45 def __init__(self, n):

Callers 2

testSumProdMethod · 0.90
__iter__Method · 0.85

Calls

no outgoing calls

Tested by 2

testSumProdMethod · 0.72
__iter__Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…