""" super 是根据当前类对象的 mro 的继承顺序进行函数的调用的 """ class Base(object): def fn(self): super(Base, self).fn() # 这里找不到fn,会到Foo里面找 print('Base.fn') class Foo(object): def fn(self): print('Foo.fn') class Q(Base,Foo): # object print('Q..') print(Q.mro()) # [<class '__main__.Q'>, <class '__main__.Base'>, <class '__main__.Foo'>, <class 'object'>] q = Q() q.fn() # 执行结果: # Foo.fn # Base.fn