python的多重继承
# 多重继承,经典钻石继承 class A: def ping(self): print('ping', self) class B(A): def pong(self): print('pong', self) class C(A): def pong(self): print('PONG', self) class D(B, C): def ping(self): super().ping() # 按照MRO找到父类的ping方法 print('post-ping:', self) def pingpong(self): self.ping() # 执行自己的ping super().ping() self.pong() super().pong()