1 class D(object): 2 pass 3 4 5 class C(D): 6 pass 7 8 9 class B(D): 10 pass 11 12 13 class A(B, C): 14 pass 15 16 17 print(A.__mro__)
利用__mro__属性可以答应出查找顺序
(<class '__main__.A'>, <class '__main__.B'>, <class '__main__.C'>, <class '__main__.D'>, <class 'object'>)