[Python-Dev] 2.5 and beyond (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jul 3 03:36:31 CEST 2006


Giovanni Bajo wrote:

I believe that names in lambdas/nested-functions referring to local names in the outer scope should really be bound at function definition time

No, you don't want that, because it would make functions that call each other very awkward to arrange.

And it's also handy that the iteration variable of the for loop is accessible after the for loop is terminated (in fact, this specific behaviour is already listed among the wont-change for Py3k).

I'd just like to point out that the create-a-new-cell behaviour that I have proposed for loop variables preserves this ability!

for new i in range(10): ... print i

will still print 9.

-- Greg



More information about the Python-Dev mailing list