New submission from bogklug <bogk...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7423>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to