>>> class A(object): pass
...
>>> A.__dict__
<dictproxy object at 0x173ef30>
>>> A.__dict__.__dict__
Traceback (most recent call last):
File "<string>", line 1, in <fragment>
AttributeError: 'dictproxy' object has no attribute '__dict__'
>>> A.__dict__.copy()
{'__dict__': <attribute '__dict__' of 'A' objects> ... }
>>> A.__dict__['__dict__']
<attribute '__dict__' of 'A' objects> # What is this object?
如果我这样做A.something = 10
,这样进入A.__dict__
。什么是这个<attribute '__dict__' of 'A' objects>
发现A.__dict__.__dict__
,当它包含的东西吗?
ive
。至少它将使这个A.__dict__['ive']
问题成为更多问题;)我会发现自己的问题