I keep trying to understand obscure Python OOP, and while abstract parent class TLogElement
does have property in1
, when I try to overrride the same property in a child class TNot
interpreter says that it doesn't have one.
Here's a fragment of TLogElement
class:
class TLogElement(ABC):
def __init__(self, _in1=None,_in2=None):
self._in1 = _in1
self._in2 = _in2
@property
@abstractmethod
def in1(self):
return self._in1
@in1.setter
@abstractmethod
def in1(self, _in1):
self._in1 = _in1
Here's a TNot
class:
class TNot (TLogElement):
def __init__(self, _in1=None, _in2=None):
super().__init__(_in1)
@property
def in1(self):
return super().in1
@in1.setter
def in1(self, _in1):
super().in1 = _in1
And that's the code which catched AttributeError: 'super' object has no attribute 'in1'
:
T = TNot()
T.in1 = 5