再谈python的属性拦截
摘要:
__setattr__是python重载协议中的内容,用于在实例中设置属性。实际使用方式:class Old(object): def __init__(self): pass def __setattr__(self, key, value): print "__setattr__: ", key, value object.__setattr__(self, key, value) def __getattribute__(self, key): print "__getattribute__: ",... 阅读全文
posted @ 2012-12-04 21:29 华子的代码空间 阅读(1035) 评论(0) 推荐(0) 编辑