staticmethod 或 classmethod
一
class C_use_staticmethod1:
def sm(in_str):
print in_str
sm = staticmethod( sm )
C_use_staticmethod1.sm("静态方法1")
二
class C_use_staticmethod2:
@staticmetho
def sm(in_str):
print in_str
C_use_staticmethod2.sm("静态方法2")
如果使用 classmethod, 需要传入 cls 对象