object.__dict__
等地有他们隐藏的方法来设置这样的事情:什么是python中的“插槽包装”?
<dictproxy {'__add__': <slot wrapper '__add__' of 'instance' objects>,
'__and__': <slot wrapper '__and__' of 'instance' objects>,
'__call__': <slot wrapper '__call__' of 'instance' objects>,
'__cmp__': <slot wrapper '__cmp__' of 'instance' objects>,
'__coerce__': <slot wrapper '__coerce__' of 'instance' objects>,
'__contains__': <slot wrapper '__contains__' of 'instance' objects>,
'__delattr__': <slot wrapper '__delattr__' of 'instance' objects>,
'__delitem__': <slot wrapper '__delitem__' of 'instance' objects>,
'__delslice__': <slot wrapper '__delslice__' of 'instance' objects>,
'__div__': <slot wrapper '__div__' of 'instance' objects>,
'__divmod__': <slot wrapper '__divmod__' of 'instance' objects>,
...
这是什么意思,他们用来做什么的?
编辑: 这是从输出:
class A:
pass
b = A()
print(type(b).__dict__)
我认为你无效地缩短了表示。它是'mappingproxy({...})'。对于一个正确的答案,这可能是一个区别。 – kay
谢谢。我看到一个说
pjc
有一个答案[这里](http://stackoverflow.com/a/19545928/2555451),可能会揭示它。 – iCodez