summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-12-27 18:24:11 +0000
committerBenjamin Peterson <benjamin@python.org>2008-12-27 18:24:11 +0000
commit8d5934b25d7c3e636444428dc715316a08b8c94e (patch)
treea1e10950058a0271d0b15d385a8edcb4c4814595 /Lib
parentc3a98034106502a661281c5198ed818849591d40 (diff)
downloadcpython-git-8d5934b25d7c3e636444428dc715316a08b8c94e.tar.gz
#4748 lambda generators shouldn't return values
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_generators.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 3702abc91a..b7c3fdcbe5 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -928,6 +928,16 @@ Test the __name__ attribute and the repr()
'f'
>>> repr(g) # doctest: +ELLIPSIS
'<generator object f at ...>'
+
+Lambdas shouldn't have their usual return behavior.
+
+>>> x = lambda: (yield 1)
+>>> list(x())
+[1]
+
+>>> x = lambda: ((yield 1), (yield 2))
+>>> list(x())
+[1, 2]
"""
# conjoin is a simple backtracking generator, named in honor of Icon's