python中:如何查看';属性对象'?;

python中:如何查看';属性对象'?;,python,Python,我创建了一个属性对象,如下所示: a=property() 但是当我跑的时候 list(a.__dict__) 它提出了一个例外: Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'int' object has no attribute '__dict__' 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 AttributeErr

我创建了一个属性对象,如下所示:

a=property()
但是当我跑的时候

list(a.__dict__)
它提出了一个例外:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute '__dict__'
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
AttributeError:'int'对象没有属性'\uu dict''

因此,我的问题是如何查看“property object”的属性?不要使用dir(),因为我不想看到从其超类继承的属性。

property对象没有属性,因为正如您所述,它没有
\uuu dict\uu
。注意:

>>> list(m for m in dir(a) if m not in dir(type(a)))
[]
如果要访问getter/setter/deleter,请按以下方式执行:

a.getter
a.setter
a.deleter

Python 2还是Python 3?在我的Python3.5.2版本中,我看到了
AttributeError:'property'对象没有属性'\uu dict'