[Python-3000] The meaning of "global variable"

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 4 01:58:07 CET 2006


Nick Coghlan wrote:

> A new keyword, on the other hand, allows the list to be split relatively 
> cleanly into four possible locations:
> 
> 1. function locals of the current function (local variables)
> 2. function locals of an enclosing function (closure variables)
> 3. module globals (global variables)
> 4. builtins (builtin names)

I don't see what's so important about treating the
module namespace differently from other lexically
enclosing scopes for the purpose of resolving names.
Especially only for *assignment* to names.

For read access, we seem to get on just fine without
any keywords to give us a hint what level to look
in. What's different about assignment that we
suddenly feel such a need for them?

--
Greg


More information about the Python-3000 mailing list