8b27482692
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
25 lines
338 B
Python
25 lines
338 B
Python
# test deeply recursive generators
|
|
|
|
|
|
# simple "yield from" recursion
|
|
def gen():
|
|
yield from gen()
|
|
|
|
|
|
try:
|
|
list(gen())
|
|
except RuntimeError:
|
|
print("RuntimeError")
|
|
|
|
|
|
# recursion via an iterator over a generator
|
|
def gen2():
|
|
for x in gen2():
|
|
yield x
|
|
|
|
|
|
try:
|
|
next(gen2())
|
|
except RuntimeError:
|
|
print("RuntimeError")
|