擅长:python、mysql、java
<p>也许<a href="https://docs.python.org/3/library/functions.html?highlight=vars#vars" rel="nofollow">documentation</a>确实回答了你的问题:</p>
<blockquote>
<p>Objects such as modules and instances have an updateable __dict__ attribute; however, other objects may have write restrictions on their __dict__ attributes (for example, classes use a dictproxy to prevent direct dictionary updates).</p>
</blockquote>