📜  激活继承函数 django - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:07.571000             🧑  作者: Mango

代码示例1
# Use the super() function to accessing inherited methods that have been overridden in a class.:
class Foo(Bar):
    def baz(self, arg):
        return super().baz(arg)

#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)