Python

  1. object.getattribute(self, name)
  2. 类中的数据描述符
  3. object.dict.get(name) 自身属性字典
  4. object.class.dict.get(name) 类属性字典 / 非数据描述符
  5. object.getattr(name)

找到一个(Repo)[https://github.com/mzohaibqc/python-attribute-lookup],里面有很棒的流程图。

Object Attribute Lookup

Class Attribute Lookup

原文地址:https://www.cnblogs.com/allen2333/p/9355668.html