多态继承顺序
class A(object): def __init__(self, a): print ('init A...') self.a = a class B(A): def __init__(self, a): super(B, self).__init__(a) print ('init B...') class C(A): def __init__(self, a): super(C, self).__init__(a) print ('init C...') class D(B, C): def __init__(self, a): super(D, self).__init__(a) print ('init D...') d = D('d')
在这个例子里面输出是按A,C ,B,D的顺序输出的,所以子类在继承的时候顺序具体是怎样的呢?根据是什么?