summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_generators.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-12-27 19:03:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-12-27 19:03:36 (GMT)
commit371ccfb5f5552d0c6abe501072aad0df9293f6fb (patch)
tree006ef6bf0b4a3f47ff241a6abfbad9799826832b /Lib/test/test_generators.py
parent5cdee16e1f3be00e52d3c7be91752bd2d19f478c (diff)
downloadcpython-371ccfb5f5552d0c6abe501072aad0df9293f6fb.zip
cpython-371ccfb5f5552d0c6abe501072aad0df9293f6fb.tar.gz
cpython-371ccfb5f5552d0c6abe501072aad0df9293f6fb.tar.bz2
Merged revisions 67954 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67954 | benjamin.peterson | 2008-12-27 12:24:11 -0600 (Sat, 27 Dec 2008) | 1 line #4748 lambda generators shouldn't return values ........
Diffstat (limited to 'Lib/test/test_generators.py')
-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 8f2da7d..9b4e342 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