python中的内建属性之__getatrribute__
python中有很多内建属性常见的有:
__init__ __str__ __new__ __del__ __repr__ __getatrribute__等等
这次来说一下__getatrribute__属性拦截器
> 先来一段代码:
> 运行结果:
分析:
19行的代码正常输出了属性subject2的值'属性拦截器不运行正常返回'
但是18行的代码却没有输出属性subj...
原创
2018-11-10 19:58:29 ·
225 阅读 ·
0 评论