class A: def f(self): print('A.f') class B(A): pass class C: def f(self): print('C.f') class D(B, C): pass D().f() # => A.f