MRO
(Source/Credits: https://dev.to/taleb/mro-4n95)
class Base: def __init__(self): print('Base.__init__') class Child1(Base): def __in...
```python
class Base: def init(self): print('Base.init')
class Child1(Base): def init(self): Base.init(self) print('Child1.init')
class Child2(Base): def init(self): Base.init(self) print('Child2.init')
class Child3(Base): def init(self): Child1.init(self) Child2.init(self) print('Child3.init')
c3 = Child3()
``
check print output is this what you expected !
Base.init
Child1.init
Base.init
Child2.init
Child3.init`
and now try this
```python class Base: def init(self): print('Base.init')
class Child1(Base): def init(self): super().init() print('Child1.init')
class Child2(Base): def init(self): super().init() print('Child2.init')
class Child3(Child1, Child2): def init(self): super().init() print('Child3.init')
c3 = Child3()
print(Child3.mro)
``
(
Comments section