Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

John Roth newsgroups at jhrothjr.com
Sat Aug 6 13:58:53 EDT 2005


"Paolino" <paolo_veronelli at tiscali.it> wrote in message 
news:mailman.2782.1123345903.10512.python-list at python.org...
> 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?
>>
>> Chris
>
> I don't think the global keyword is useful actually.
>
> What's so special in a module nemespace to be priviledged like that.

> The point IMO is accessing names defined somewhere in the enclosing 
> namespaces.

The issue isn't _accessing_ the module namespace. It's
binding to identifiers in the module  namespace.

The reason is that _assigning_ to an identifier in a
function or method makes that identifier local, so
there needs to be a simply way of saying that you
want to be able to assign to an identifier in the
module namespace. (There's already a more
complicated way: use the global() built-in function.)

John Roth


> Regards Paolino




More information about the Python-list mailing list