summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_generators.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r--Lib/test/test_generators.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 7eac9d0..f88c762 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -1830,13 +1830,7 @@ Yield by itself yields None:
[None]
-
-An obscene abuse of a yield expression within a generator expression:
-
->>> list((yield 21) for i in range(4))
-[21, None, 21, None, 21, None, 21, None]
-
-And a more sane, but still weird usage:
+Yield is allowed only in the outermost iterable in generator expression:
>>> def f(): list(i for i in [(yield 26)])
>>> type(f())
@@ -2106,10 +2100,6 @@ enclosing function a generator:
>>> type(f())
<class 'generator'>
->>> def f(): x=(i for i in (yield) if (yield))
->>> type(f())
-<class 'generator'>
-
>>> def f(d): d[(yield "a")] = d[(yield "b")] = 27
>>> data = [1,2]
>>> g = f(data)