[Python-Dev] nested scopes confusion (original) (raw)

Martin v. Loewis martin@v.loewis.de
Tue, 4 Dec 2001 21:17:46 +0100


So nested scopes are not really an alternative (at least in this case) to the 'lambda self, i=i: i' trick.

In this case, they aren't. In many other cases (e.g. when the variable from the outer scope is self), nobody will assign to this variable, in which case this does exactly the same thing as the i=i trick.

Regards, Martin