浅谈python MRO与Mixin模式

MRO(Method Resolution Order)

In object-oriented programming languages with multiple inheritance, the diamond problem (sometimes referred to as the “deadly diamond of death”) is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C?

官方文档: https://www.python.org/download/releases/2.3/mro/

参考:

  • Python Mixin 学习笔记
  • 关于Python的Mixin模式

你可能感兴趣的:(python)