使用super()
函数:
class Foo(Bar):
def baz(self, arg):
return super().baz(arg)
对于 Python <3、您必须明确选择使用新样式类并使用:
For Python < 3, you must explicitly opt in to using new-style classes and use:
class Foo(Bar):
def baz(self, arg):
return super(Foo, self).baz(arg)