摘要: __slots__在python中是扮演属性声明(Attribute Declaration)的角色,当然属性本身不用声明,只需要在使用前赋值即可,但是实际上,属性的应用远非在使用前赋值就行,所以有attribute declaration, attribute accessor,attribute 阅读全文
posted @ 2019-03-02 21:47 JohnYang819 阅读(1137) 评论(0) 推荐(1) 编辑
摘要: python2.x中的新类型类(New-style class)与python3.x的类一致,均继承object类,而不继承object的类称为经典类(classic class),而对于这两种类,一般实例属性截取函数(generic instance attribute interception 阅读全文
posted @ 2019-03-02 17:09 JohnYang819 阅读(445) 评论(0) 推荐(0) 编辑