[Python-ideas] For loop binding (was Re: Tweaking closures ...)
masklinn at masklinn.net
Thu Sep 29 13:16:09 CEST 2011
On 2011-09-29, at 12:52 , Greg Ewing wrote:
> Terry Reedy wrote:
>> No, for loops *do* rebind loop variables each time around.
> I probably should have avoided the word "bind", because it
> can be ambiguous. What I mean is that it assigns a different
> value to the same variable instead of creating a new
> variable. This is different from what equivalent constructs
> in some other languages do.
breaker of those rules) C-type languages create a new scope
every time instead of being solely function-scoped no? So
the construct closes over a new name in a different lexical
in the same lexical.
It's not about rebinding so much as about the breadth of
More information about the Python-ideas