MCPcopy
hub / github.com/Nuitka/Nuitka / __next__

Method __next__

tests/basics/GeneratorExpressionsTest.py:29–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 return self
28
29 def __next__(self):
30 print("Next of", self.x, "is", self.count)
31
32 if len(self.values) > self.count:
33 self.count += 1
34
35 return self.values[self.count - 1]
36 else:
37 print("Raising StopIteration for", self.x)
38
39 raise StopIteration
40
41 # Python2/3 compatibility.
42 next = __next__

Callers

nothing calls this directly

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected