Is mymodule.myvariable a 'global'? (What is proper definition of 'global variable'?)

Michael Ekstrand mekstran at scl.ameslab.gov
Sun Aug 21 17:21:39 EDT 2005


On 21 Aug 2005 09:45:26 -0700
"seberino at spawar.navy.mil" <seberino at spawar.navy.mil> wrote:
> Python lets me access module level variables from *anywhere*.  All I
> have
> to do is add module name in front.
> 
> e.g.
> 
> mymodule.myvariable
> 
> Is this considered a 'global'?  Or, does a 'global variable' have to
> be accessible anywhere *without* a namespace in front?

Whether or not it is a true academic global, such a variable is what
Python calls a global. There is no way to make a variable universally
accessible without a namespace.

-Michael



More information about the Python-list mailing list