Non-obvious name bindings
warkid at storm.ru
Mon Nov 5 13:49:52 CET 2001
It seemed that it was my failure of understanding python but the
fact that introducing variable in list comprehension binds it to
functions scope(as every declaration means to?) is not really
I mean this:
>>> [e for e in ['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.
What are your thoughts?
Kerim mailto:warkid at storm.ru
More information about the Python-list