loop scope

Terry Reedy tjreedy at udel.edu
Fri Mar 12 14:46:21 EST 2004


"David MacQuigg" <dmq at gain.com> wrote in message
news:utn350d54pjtrsi1a6sd4ckg82mnq2uf4b at 4ax.com...
> The one exception I can think of is what Terry Reedy mentioned - the
> iteration variable in a list comprehension.  In some future
> optimization, they may neglect to save that variable.  I hope they
> don't do that (even though it really has no use).  I just like the
> consistency we now have in treatment of all local variables.

Please see other post.  In the future, the consisitency will be with
generator comprehensions, where the loop variable is clearly encapsulated
inside the induced generator function.

Terry J. Reedy







More information about the Python-list mailing list