class Base: def play(self): print('这是Base') class A(Base): def play(self): print('这是A') class B(Base): def play(self): print('这是B') class C(A,B): def play(self): super().play() #super(C,self).play() 两个写法,作用一样 #D.play() print('这是C') c = C()
class Base: def play(self): print('这是Base') class A(Base): def play(self): print('这是A') class B(Base): def play(self): print('这是B') class C(A,B): def play(self): super().play() #super(C,self).play() 两个写法,作用一样 #D.play() print('这是C') c = C()