class B():
def __init__(self,b,*args,**kwargs):
self.b = b
def show(self):
print(self.b)
class B1(B):
def __init__(self,b,b1,*args,**kwargs):
super(B1,self).__init__(b,*args,**kwargs)
self.b1 = b1
def show(self):
print(self.b,self.b1)
class B2(B):
def __init__(self,b,b2,*args,**kwargs):
super(B2,self).__init__(b,*args,**kwargs)
self.b2=b2
def show(self):
print(self.b,self.b2)
class D(B1,B2):
def __init__(self, b ,b1,b2,d):
super(D,self).__init__(b,b1,b2)
self.d = d
def show(self):
print(self.b,self.b1,self.b2,self.d)
print(D.mro())
d = D(1,2,3,4)
d.show()
标签:__,顺序,self,init,MRO,b1,b2,def
From: https://www.cnblogs.com/jiyiran/p/16869140.html