Browse Source

tests/stress/recursive_gen: Add test for recursive gen with iter.

pull/3708/head
Damien George 7 years ago
parent
commit
605fdcf754
  1. 11
      tests/stress/recursive_gen.py

11
tests/stress/recursive_gen.py

@ -1,9 +1,18 @@
# 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')

Loading…
Cancel
Save