python中类方法,静态方法和实例方法的作用和区别
class A(object):# 构造函数def __init__(self, title1):self.title title1print(self.title)# 实例函数def foo(self, title2):print(title2)# 静态函数staticmethoddef static_foo():print("静态方法")# 类函数classmethoddef cls_foo(cls):cls.foo(a,"类函数…
2026/8/23 7:51:59