python一切是对象
对象由类来创建
通过类的方法来定义一类对象
对象方法=>self
通过类方法规范一种类
类方法=>cls
@classmethod def test2(cls): print cls print 'test2' print TestClassMethod.METHOD print '----------------'
静态方法=>null(非self 非cls)
@staticmethod def test3(): print TestClassMethod.METHOD print 'test3'
查看方法
type()
dir()
内置方法 __xx__
非内置方法 只有一种表示方式 只有一种执行方式
内置方法可能有多种执行方式如:__call__