【发布时间】:2021-04-25 17:34:46
【问题描述】:
在 Python 中,如何获取一个类的所有 属性,即由 @property 装饰器创建的所有成员?
stackoverflow 上至少有两个问题[1, 2] 混淆了术语 property 和 attribute,误认为 property 作为 attribute 的同义词,这在 Python 上下文中具有误导性。因此,即使其他问题的标题可能暗示了这一点,它们也没有回答我的问题。
[1]:Print all properties of a Python Class
[2]:Is there a built-in function to print all the current properties and values of an object?
【问题讨论】:
标签: python properties code-inspection