Moving to functional programming

Terry Reedy tjreedy at
Wed Jul 16 08:32:13 CEST 2008

Ben Finney wrote:
> Paul Rubin <> writes:
>> I don't like square-bracket listcomps because they leak the index
>> variables to the outside.
> According to PEP 289 <URL:>,
> this is an acknowledged wart that will be fixed in Python 3.0.

Has been.
IDLE 3.0b1
 >>> a=[i for i in range(5)]
 >>> i
Traceback (most recent call last):
   File "<pyshell#1>", line 1, in <module>
NameError: name 'i' is not defined

More information about the Python-list mailing list