局部优先级排序 和 单调性 的线性化 方法解析顺序 Method Resolution Order
对于多继承层级结构,线性化的构造就比较麻烦了,因为要构造一个尊重 局部优先级排序 和 单调性 的线性化将更为困难
Python 2.3 方法解析顺序 — Python 3.15.2 文档
The Python 2.3 Method Resolution Order — Python 3.15.2 documentation
Object-oriented languages with multiple inheritance and automatic conflict resolution typically use a linearization of superclasses to determine which version of a property to inherit when several superclasses provide definitions. Recent work has defined several desirable characteristics for hnearizations, the most important being monotonicity, which prohibits inherited properties from skipping over direct superclasses. Combined with Dylan’s sealing mechanism, a monotonic linearization enables some compile-time method selection that would otherwise be impossible in the absence of a closed-world assumption.
The Dylan linearization is monotonic, easily described, strictly observes local precedence order, and produces the same ordering as CLOS when that is monotonic. We present an implementation based on merging and a survey of class heterarchies from several large programs, analyzing where commonly used linearizations differ.

浙公网安备 33010602011771号