擅长:python、mysql、java
<p>这里有一篇很好的文章解释了<code>__dict__</code>:</p>
<p><a href="http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#the-dynamic-dict" rel="nofollow noreferrer">The Dynamic <strong>dict</strong></a></p>
<p><code>attrdict</code>类通过从字典继承然后将对象的<code>__dict__</code>设置为该字典来利用此漏洞。因此,对父字典(即它继承的<code>dict</code>类)进行任何属性访问。</p>
<p>本文的其余部分对于理解Python对象也很有帮助:</p>
<p><a href="http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html" rel="nofollow noreferrer">Python Attributes and Methods</a></p>