擅长:python、mysql、java
<p>作为<a href="https://docs.python.org/2/library/functions.html#vars" rel="nofollow">the documentation states</a>:</p>
<blockquote>
<p>Without an argument, <code>vars()</code> acts like <code>locals()</code>. </p>
</blockquote>
<p>切换到<code>locals</code>,然后:</p>
<blockquote>
<p><strong>Note</strong>: The contents of this dictionary should not be modified; changes may not affect the values of local and free variables used by the interpreter.</p>
</blockquote>
<p>请注意,<em>“may not”</em>;undefined确切地说,对于应该发生的事情没有确切的定义。换言之,它不能保证,您不应该编写依赖它的代码(无论哪种方式)。你知道吗</p>