Non-obvious name bindings

Fernando Pérez fperez528 at yahoo.com
Mon Nov 12 13:20:57 EST 2001


Don Garrett wrote:

>> >
>> >   I mean this:
>> >
>> > >>> [e for e in ['exists']]
>> > ['exists']
>> > >>> e
>> > 'exists'
>> >
>> >   And I'm still confused - those "temporary" variables declaration
>> >   looks so "innocent", and in most cases (in every case for list
>> >   comprehensions I guess?) it's everyones intension not to use this
>> >   variable somewhere outside the loop.
>> >

This is a bug in Python 2.1, very recently fixed. I posted about it a few 
days ago, and this is the reply Tim Peters gave me:


See

<http://sf.net/tracker/?group_id=5470&atid=105470&func=detail&aid=471928>

This was a bug, and was fixed last month (for 2.2; perhaps also for 2.1.2).


Cheers,

f.



More information about the Python-list mailing list