Style question on recursive generators

Terry Reedy tjreedy at
Wed Oct 20 19:43:33 CEST 2004

"Carlos Ribeiro" <carribeiro at> wrote in message 
news:864d3709041020101810f92d25 at
> 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