[Python-3000] Draft PEP for outer scopes

Josiah Carlson jcarlson at uci.edu
Thu Nov 2 23:19:27 CET 2006


"Delaney, Timothy (Tim)" <tdelaney at avaya.com> wrote:
> If "global" were to change in Py3K to require an existing binding at the
> time the "global" keyword was executed, this would then have the
> semantics of "nonlocal" and be context-independent again. So I think any
> proposal to reuse "global" has to include these semantics.

Maybe, but it would break currently existing (and working) code like the
following...

#no foo = declaration

def init_foo():
    global foo
    foo = ...

I use variants of the above in a few places.  Could I initialize foo =
None in the module namespace prior to running init_foo()?  Sure, but
that may or may not clutter up definitions contained in the module.

 - Josiah



More information about the Python-3000 mailing list