I am trying to get into Python and to understand multiple-inheritance in Python. The problem I'm having is that I am trying to call the constructors of "Base1" and "Base2" in "Inheriting12". I was trying to test the result by having each constructor print the classes name however for some reason only the name of the class that comes first in the brackets of the class definition for "Inheriting12" gets printed
class Base1:
def __init__(self):
print("Base1")
class Base2:
def __init__(self):
print("Base2")
class Inheriting12(Base1, Base2):
def __init__(self):
super().__init__()
print("Inheriting")
i = Inheriting12()
The printed messages are:
Base1
Inheriting12