C3算法
class A(object): pass class B(A): pass class C(A): pass class D(B): pass class E(C): pass class F(D,E): pass F的mro顺序 第一步 找出F所有的父类的MRO D [DBAO] E [ECAO] 第二部 把所有父类的MRO 以及 所有的父类做归并算法 [DBAO] [ECAO] [DE] F + merge([DBAO] [ECAO] [DE]) 取第一个表的表头 满足其他表的去掉表头部门不能含有这个表头 如果不满足取第二个表表头 FD + merge([BAO] [ECAO] [E]) FDB + merge([AO] [ECAO] [E]) FDBE + merge([AO] [CAO]) FDBEC + merge([AO] [AO]) FDBECAO print(F.__mro__)