### (classmethod) trap_http_exception

• 成员方法：类方法中第一个参数是self的为类成员方法。
• classmethod 类方法中第一个参数是cls（类对象）的方法
• property 类变量的只读方法: 使用了装饰器@property的方法
• staticmethod： 使用了装饰器@staticmethod的静态方法。静态方法和类方法相似，区别是静态方法不关注对象和对象内部属性，静态方法不强制要求参数。
• setupmethod

@classmethod means: when this method is called, we pass the class as the first argument instead of the instance of that class (as we normally do with methods). This means you can use the class and its properties inside that method rather than a particular instance.
@staticmethod means: when this method is called, we don't pass an instance of the class to it (as we normally do with methods). This means you can put a function inside a class but you can't access the instance of that class (this is useful when your method does not use the instance).

posted @ 2017-09-26 10:12  柯君  阅读(...)  评论(...编辑  收藏