We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22f1414 commit 605fdcfCopy full SHA for 605fdcf
1 file changed
tests/stress/recursive_gen.py
@@ -1,9 +1,18 @@
1
# test deeply recursive generators
2
3
+# simple "yield from" recursion
4
def gen():
5
yield from gen()
-
6
try:
7
list(gen())
8
except RuntimeError:
9
print('RuntimeError')
10
+
11
+# recursion via an iterator over a generator
12
+def gen2():
13
+ for x in gen2():
14
+ yield x
15
+try:
16
+ next(gen2())
17
+except RuntimeError:
18
+ print('RuntimeError')
0 commit comments