Python - Redefining class attribute in a derived class
stackoverflow.com › questions › 19377255Oct 15, 2013 · Here's an example of why it does not work: class Base(object): __flag = 'base' _other_flag = 'base' def __init__(self) : pass @classmethod def flag(self): return self.__flag @classmethod def other_flag(self): return self._other_flag class Derived(Base): __flag = 'derived' _other_flag = 'derived' print 'base flag', Base.flag() print 'derived flag', Derived.flag() print 'base other flag', Base.other_flag() print 'derived other flag', Derived.other_flag() # Note the following 2 statements ...