What’s the right syntax for calling the base constructors of multiple derived classes in python3?
class A:
def __init__():
print("A")
class B:
def __init__():
print("B")
class C(A,B):
def __init__():
super().__init__() # ???
You have to put the
supercall in the parent classes too. I think how it works isC‘ssupergetsAandA‘ssuperget’sBOr use this alternative, more explicit syntax which I prefer
This calls the
__init__methods of theAandBclasses on an object of theCclass.