variable scope

Joel Juvenal Rivera Rivera joelriv at gmail.com
Fri Sep 25 16:57:46 EDT 2009


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




More information about the Python-list mailing list