Python critique

Stefan Behnel stefan_ml at behnel.de
Fri Dec 10 09:30:56 EST 2010


Jean-Michel Pichavant, 10.12.2010 15:02:
> the shadow declaration of some python construct in the current scope.
>
> print x # raise NameError
> [x for x in range(10)] # shadow declaration of x
> print x # will print 9

Note that this is rarely a problem in practice, and that this has been 
fixed in Python 3.

Stefan




More information about the Python-list mailing list