Nested scopes: why is it weird?

Brian Quinlan BrianQ at
Fri Sep 7 23:13:52 CEST 2001

Cliff wrote:
> It silently does the right thing.  Changing the value of a
> variable from an enclosing scope is a _bad_ idea.  This is
> what is called a "side effect" and was one of the things
> structured programming was created to prevent.

I'm pretty sure that Paul was arguing that you should not be able to
shadow variables used in enclosing lexical scopes i.e. it would be an
error to rebind a name used in an enclosing lexical scope.


More information about the Python-list mailing list