[issue2344] Using an iteration variable outside a list comprehension needs a Py3K warning

Taek Joo Kim report at bugs.python.org
Tue Mar 18 01:59:57 CET 2008


Taek Joo Kim <taicki at gmail.com> added the comment:

>>> i = 3
>>> [i for i in range(10)]
>>> i
9

In 2.6, the original value of a variable is changed by the list
comprehension. In 3.0, it is not. To fix this, we need many changes on AST.

----------
nosy: +taicki

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2344>
__________________________________


More information about the Python-bugs-list mailing list