Python中子类怎样调用父类方法?

子类调用父类函数有以下方法:

直接写类名调用

用super(type,obj).method(arg)方法调用。

在类定义中调用本类的父类方法,可以直接用super().method(arg)

classA:

defmethod(self,arg):

pass

classB(A):

defmethod(self,arg):

#A.method(self,arg)#1

#super(B,self).method(arg)#2

super().method(arg)#3