在 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?