
Jan. 23, 2016
9:16 p.m.
Guido van Rossum wrote:
So, I don't really want to introduce "for new x in ..." because it suddenly introduces a completely different concept into the language,
What dict hold x in "for new x ..."? It would have to be considered a new dict created just to hold x, but other variables assigned in the body of the for loop would still be in the dict holding all the other locals of the function.
We could say that the body of a "for new" loop is a nested scope in which all other referenced variables are implicitly declared "nonlocal". -- Greg