python multiple inheritance passing arguments to constructors using super
问题 Consider the following snippet of python code class A(object): def __init__(self, a): self.a = a class B(A): def __init__(self, a, b): super(B, self).__init__(a) self.b = b class C(A): def __init__(self, a, c): super(C, self).__init__(a) self.c = c class D(B, C): def __init__(self, a, b, c, d): #super(D,self).__init__(a, b, c) ??? self.d = d I am wondering how can I pass a , b and c to corresponding base classes' constructors. 回答1: Well, when dealing with multiple inheritance in general, your