variable scope

Discussion in 'Python' started by Joel Juvenal Rivera Rivera, Sep 25, 2009.

  1. Hi i was playing around with my code the i realize of this

    ###################
    _uno__a = 1
    class uno():
    __a = 2
    def __init__(self):
    print __a
    uno()
    ###################
    and prints 1

    So when i create class uno in the __init__ calls the global _uno__a when
    i refer just __a ? it's some kind of "private global" variable?

    Regards

    Joel Rivera
    Joel Juvenal Rivera Rivera, Sep 25, 2009
    #1
    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. Paul Opal
    Replies:
    12
    Views:
    933
    Paul Opal
    Oct 11, 2004
  2. ann
    Replies:
    13
    Views:
    654
    Patricia Shanahan
    Sep 13, 2005
  3. Steven T. Hatton
    Replies:
    9
    Views:
    463
  4. David Filmer
    Replies:
    19
    Views:
    227
    Kevin Collins
    May 21, 2004
  5. Andrew Falanga
    Replies:
    2
    Views:
    194
    Andrew Falanga
    Nov 22, 2008
Loading...

Share This Page