类方法和静态方法都实例化的对象无关,但到底有什么区别呢
class Employee:@classmethoddef classmthd(*args):return args@staticmethoddef staticmthd(*args):return args# 类方法print(Employee.classmthd())print(Employee.classmthd('test'))# 静态方法print(Employee.staticmthd())print(Employee.staticmthd('test'))
(class '__main__.Employee',)(class '__main__.Employee', 'test')()('test',)
