class Test(object): x = 11 def __init__(self, _x): self._x = _x print("Test.__init__") @classmethod def class_method(cls): # 类方法 print("class_method") @staticmethod def static_method(): # 静态方法 print("static_method") @classmethod def getPt(cls): cls.class_method() cls.static_method()
原文:http://www.cnblogs.com/hutzerg/p/6393109.html