[issue5577] yield in iterators
qwjqwj
report at bugs.python.org
Fri Mar 27 13:25:15 CET 2009
New submission from qwjqwj <qwj at papayamobile.com>:
In Python 3.0,3.1a1:
>>> def f():
[(yield i) for i in range(10)]
>>> f()
>>> f() is None
True
>>> def f():
((yield i) for i in range(10))
>>> f()
>>> f() is None
True
However it is correct in Python 2.5,2.6
>>> def f():
... [(yield i) for i in range(10)]
...
>>> f()
<generator object f at 0x2b84bbe3ae60>
----------
components: Interpreter Core
messages: 84257
nosy: qwjqwj
severity: normal
status: open
title: yield in iterators
type: behavior
versions: Python 3.0, Python 3.1
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5577>
_______________________________________
More information about the Python-bugs-list
mailing list