Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)
k04jg02 at kzoo.edu
Sat Aug 6 07:44:07 CEST 2005
seberino at spawar.navy.mil wrote:
>I've heard 2 people complain that word 'global' is confusing.
>Perhaps 'modulescope' or 'module' would be better?
>Am I the first peope to have thought of this and suggested it?
>Is this a candidate for Python 3000 yet?
Hmm.. instead of 'global', how about 'outside' ? It seems a bit more
intuitive to me because it suggests that you mean, "the variable defined
outside this scope" or outside any nestedness.
But then again it could be confused to mean "just one scope above this
one" which isn't necessarily module scope (nested functions, etc.)...
still, might be less confusing than 'global'.
Another alternative to having to say "global var" would be to use some
sort of indicator that you want the global with each usage, like,
"global.var" or "outside.var"
More information about the Python-list