variable scope

  • Thread starter Joel Juvenal Rivera Rivera
  • Start date
J

Joel Juvenal Rivera Rivera

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top