summaryrefslogtreecommitdiff
path: root/tests/basics/gen_yield_from.py
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-11 16:45:30 -0400
committerDan Halbert <halbert@halwitz.org>2018-07-11 16:45:30 -0400
commit7c219600a246d8956d0b23ea3f5d125a820e6b6a (patch)
tree4cf793a66284322d48a8f430815c31cd1c9ffa1d /tests/basics/gen_yield_from.py
parent4962468ffffac9ec4e36b2b1fc3f132516df3127 (diff)
parent25ae98f07cb3c4488cb955403dfe56b8bb8db6f0 (diff)
WIP: after merge; before testing
Diffstat (limited to 'tests/basics/gen_yield_from.py')
-rw-r--r--tests/basics/gen_yield_from.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/gen_yield_from.py b/tests/basics/gen_yield_from.py
index 5196b48d2..4e68aec63 100644
--- a/tests/basics/gen_yield_from.py
+++ b/tests/basics/gen_yield_from.py
@@ -40,3 +40,16 @@ def gen6():
g = gen6()
print(list(g))
+
+# StopIteration from within a Python function, within a native iterator (map), within a yield from
+def gen7(x):
+ if x < 3:
+ return x
+ else:
+ raise StopIteration(444)
+
+def gen8():
+ print((yield from map(gen7, range(100))))
+
+g = gen8()
+print(list(g))