Style question on recursive generators

Terry Reedy tjreedy at udel.edu
Wed Oct 20 13:43:33 EDT 2004


"Carlos Ribeiro" <carribeiro at gmail.com> wrote in message 
news:864d3709041020101810f92d25 at mail.gmail.com...
> I've read somewhere else that there are plans to make the loop
> variable to be limited in scope _to the loop only. Not sure about the
> details though.

I believe that might have happened already for the loop var *within* a list 
comprehension, and maybe within a generator expression (easy to test).  As 
I remember, the idea has been explicitly rejected for the loop var in for 
statements, which will remain compatible with equivalent while loops with 
explicitly assigned vars.

Terry J. Reedy






More information about the Python-list mailing list