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

Paolino paolo_veronelli at
Sat Aug 6 19:26:43 CEST 2005

seberino at 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 

def enclosing():
   def enclosed():
     outer var=4

this is the base of something useful.

as it is now you neeed

def enclosing():
   class Var:_=2
   def enclosed():
or like others suggested

def enclosing():
   def enclosed():
which is like saying python is not working

It's ok to mark non locals,but why var=4 is not searched outside and 
var[0]=4 yes?

I think there is only one or none possible solution to an 'outer' 
statement which is the first bound name matching the 'outer' vars name 
in the chain of enclosing namespaces.

Why every instance doesn't point to its namespace and every namespace to 
its namespace? Unpythonic ?

Illogicities to my eyes or at least non-linerities that makes 'global' 
an interesting strangeness to talk about.

And that namespaces should start being easy sooner or later.

Regards Paolino


Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB

More information about the Python-list mailing list