代码:
class Classname: # 普通方法 def b(self): print('普通方法') @staticmethod def fun(): print('静态方法') @classmethod def a(cls): print('类方法') class ClassName(Classname): def __init__(self): super().fun() self.fun() super().a() self.a() super().b() self.b() print(ClassName()) Classname.fun() Classname.a() # print(Classname.b())
解释: