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

Method sync_iterate

Lib/test/test_asyncgen.py:137–147  ·  view source on GitHub ↗
(g)

Source from the content-addressed store, hash-verified

135
136 def compare_generators(self, sync_gen, async_gen):
137 def sync_iterate(g):
138 res = []
139 while True:
140 try:
141 res.append(g.__next__())
142 except StopIteration:
143 res.append('STOP')
144 break
145 except Exception as ex:
146 res.append(str(type(ex)))
147 return res
148
149 def async_iterate(g):
150 res = []

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
appendMethod · 0.45
__next__Method · 0.45

Tested by

no test coverage detected