[Python-3000] Draft PEP for outer scopes
Christian Tanzer
tanzer at swing.co.at
Thu Nov 2 10:03:24 CET 2006
Ka-Ping Yee <python at zesty.ca> wrote:
> Guido wrote:
> > My personal preference is still to abuse 'global' instead of adding a
> > new, ugly keyword. That would make the syntax for global and nonlocal
> > completely identical. :-) But I seem to be alone in this preference.
>
> Brett wrote:
> > Seeing Guido have a sad face is enough to force me to have an opinon. I
> > personally always viewed 'global' as "this variable is not local", so making
> > it truly mean that works for me.
>
> I'm convinced that "global variable" means top-level for most
> programmers and so this usage would be confusing -- but i think we're
> all just repeating what we've said before.
Well, for many programmers `global` means visible everywhere in the
program, so Python's use of the word is already confusing for some
people. But that confusion usually doesn't last long and neither would
the proposed reinterpretation's, IMHO.
OTOH, having `global` and `nonlocal` mean the same thing for
module-bound variables violates TOOWTDI.
--
Christian Tanzer http://www.c-tanzer.at/
More information about the Python-3000
mailing list