Nested scopes: why is it weird?

Brian Quinlan BrianQ at ActiveState.com
Fri Sep 7 17:13:52 EDT 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.

Cheers,
Brian





More information about the Python-list mailing list