python multiple inheritance: avoid calling the constructors twice in diamond shape
问题 Consider the following code: class A(object): def __init__(self): print("A.__init__") super(A, self).__init__() # 1 print("A.__init__ finished") class B(A): def __init__(self): print("B.__init__") super(B, self).__init__() # 2 print("B.__init__ finished") class C(A): def __init__(self): print("C.__init__") super(C, self).__init__() print("C.__init__ finished") class D(B, C): def __init__(self): print("D.__init__") print("Initializing B") B.__init__(self) # 3 print("B initialized") print(