I have doubt if multiple classes inherited to a derived class. How can we call the init of all base classes.
class Base1(object):
def __init__(self):
print('Constructor of Base1 Class')
class Base2(object):
def __init__(self):
print('Constructor of Base2 Class')
class Base3(object):
def __init__(self):
print('Constructor of Base3 Class')
class Derived(Base1, Base2, Base3):
def __init__(self):
super(Derived, self).__init__()
print('Constructor of Derived Class')
if __name__ == '__main__':
inst = Derived()
When i run the above code. I get the output as below
Constructor of Base1 Class
Constructor of Derived Class
I think Base2 and Base3 __init__ are not getting called. Is there a way to do it