The following piece of code:
class A:
def __init__(self):
self.__var = 123
def getV(self):
return self.__var
a = A()
a.__var = 10
print a.getVar(), a.__var
prints 123 10. Why does this behavior occur? I would expect a.getVar() to print out 10. Does the class internally interpret self.__var as self._A__var?