ylliX - Online Advertising Network

Using @property to clone attributes initialized from superclass

I want to create a class inheriting from a superclass that keeps track of the already initialized class attributes in the superclass. The @property decorator caught my eye and I tried to implement it (see example below). class MyClass(): def __init__(self): self.data=”myinitialdata” class MySubClass(MyClass): def __init__(self, myclass): super().__init__() self._myclass = myclass @property def data(self): return […]