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

Class E2

Lib/test/test_itertools.py:2180–2192  ·  view source on GitHub ↗

Test propagation of exceptions after two iterations

Source from the content-addressed store, hash-verified

2178 3 // 0
2179
2180class E2:
2181 'Test propagation of exceptions after two iterations'
2182 def __init__(self, seqn):
2183 self.seqn = seqn
2184 self.i = 0
2185 def __iter__(self):
2186 return self
2187 def __next__(self):
2188 if self.i == 2:
2189 raise ZeroDivisionError
2190 v = self.seqn[self.i]
2191 self.i += 1
2192 return v
2193
2194class S:
2195 'Test immediate stop'

Callers 1

test_batchedMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_batchedMethod · 0.56