Suppose I have a base class, where there's a __flag attribute accessible by a @classmethod.
class Base(object):
__flag = None
def __init__(self) :
pass
@classmethod
def flag(self):
return self.__flag
Suppose I also have a derived class where I change the attribute.
class Derived(Base):
__flag = True
Then, when I try to access the attribute of the derived class, I get the attribute of the base class:
In [3]: print Derived.flag()
None
Why? I really can not understand.