[New-bugs-announce] [issue7423] nested generator expression produces strange results
bogklug
report at bugs.python.org
Wed Dec 2 02:34:25 CET 2009
New submission from bogklug <bogklug at gmail.com>:
The first of the two maps below gives strange result due to the nested
generator expression (I guess it should give the same result as the
second map).
In [1]: map(list, [(x+y for y in 'c') for x in 'ab'])
Out[1]: [['bc'], ['bc']]
In [2]: map(list, [[x+y for y in 'c'] for x in 'ab'])
Out[2]: [['ac'], ['bc']]
----------
components: Interpreter Core
messages: 95890
nosy: bogklug
severity: normal
status: open
title: nested generator expression produces strange results
type: behavior
versions: Python 2.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7423>
_______________________________________
More information about the New-bugs-announce
mailing list