[Python-ideas] For-loop variable scope: simultaneous possession and ingestion of cake

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Oct 5 02:40:53 CEST 2008


Terry Reedy wrote:

> What if I *want* a closure to be over variables, 
> as normal, instead of values.

You can always assign the loop value to another variable
inside the loop. Or use some other approach, such as a
while loop.

-- 
Greg



More information about the Python-ideas mailing list