经典类:深度优先,F->D->B->A->E->C->H
新式类:广度优先,F->D->B->E->C->H->A
class A:
# def test(self):
# print('from A')
pass
class B(A):
# def test(self):
# print('from B')
pass
class C(A):
# def test(self):
# print('from C')
pass
class D(B):
# def test(self):
# print('from D')
pass
class E(C):
# def test(self):
# print('from E')
pass
class H(A):
def test(self):
print('from H')
pass
class F(D,E,H):
# def test(self):
# print('from F')
pass
f=F()
f.test()
print(F.mro())
展开