Why are classes being ordered this way in the MRO?
问题 I have a problem with the Python MRO For this code: class F: pass class G: pass class H: pass class E(G,H): pass class D(E,F): pass class C(E,G): pass class B(C,H): pass class A(D,B,E): pass print(A.__mro__) I get this output: (<class '__main__.A'>, <class '__main__.D'>, <class '__main__.B'>, <class '__main__.C'>, <class '__main__.E'>, <class '__main__.G'>, <class '__main__.H'>, <class '__main__.F'>, <class 'object'>) Why do I get <class '__main__.C'> before <class '__main__.E'> ? I thought