469,343 Members | 5,380 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

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

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?

(I'm not sure what proper academic definition of 'global variable' is.)

Thanks!

Chris

Aug 21 '05 #1
1 1316
On 21 Aug 2005 09:45:26 -0700
"se******@spawar.navy.mil" <se******@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
Aug 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

35 posts views Thread by whisper | last post: by
8 posts views Thread by chellappa | last post: by
44 posts views Thread by fabio | last post: by
7 posts views Thread by zeecanvas | last post: by
10 posts views Thread by subramanian100in | last post: by
15 posts views Thread by =?Utf-8?B?UGF0Qg==?= | last post: by
112 posts views Thread by istillshine | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.