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

Discussion in 'Python' started by seberino@spawar.navy.mil, Aug 21, 2005.

  1. Guest

    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, 2005
    #1
    1. Advertising

  2. Re: Is mymodule.myvariable a 'global'? (What is proper definitionof 'global variable'?)

    On 21 Aug 2005 09:45:26 -0700
    "" <> 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
    Michael Ekstrand, Aug 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pierre Yves
    Replies:
    2
    Views:
    470
    Pierre Yves
    Jan 10, 2008
  2. Atropo
    Replies:
    3
    Views:
    2,869
    Atropo
    May 23, 2008
  3. Devin
    Replies:
    7
    Views:
    289
    Martin v. Löwis
    Oct 4, 2008
  4. Samuel Wan
    Replies:
    1
    Views:
    512
  5. 7stud --
    Replies:
    13
    Views:
    200
    7stud --
    Sep 12, 2007
Loading...

Share This Page