__getattr__ VS __getattribute__

__getattr__ 和__setattr__ 不是一对。

 __getattribute__和setattr__ 一对。


__getattr__只有在调用__getattribute__取不到值得时候才会被调用。


可以参见标准库的第三章具体说明。


<完>

你可能感兴趣的:(__getattr__ VS __getattribute__)