擅长:python、mysql、java
<p><code>TestA</code>的<code>dictionary</code>属性属于类而不是它的实例。这就是<code>TestA</code>的所有实例看起来相同的原因。您应该这样做:</p>
<pre><code>class TestA:
def __init__(self):
self.dictionary = dict() # this will make dictionary belong to the instance, and each instance will get its own copy of dictionary
</code></pre>