[Python-Dev] Re: Re: closure semantics

Greg Ewing greg at cosc.canterbury.ac.nz
Sat Oct 25 18:51:50 EDT 2003


> But what about name mismatches?  Global statements allows functions to
> create 'new' variables in the module scope and not just 'existing'
> ones.  What about for in-between scopes?

It's probably a misfeature of the global statement that it allows
that, but if we're going to re-use it in the form of a "global x in
scope" statement, we should keep the behaviour the same for nested
scopes in the interests of consistency.

Maybe this is an argument for introducing an "outer" statement,
which requires an existing binding (determined by existence of
an assignment at compile time) even for the module scope, and
deprecating "global" altogether.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list