擅长:python、mysql、java
<p>这似乎奏效了:</p>
<pre><code>class A(object):
attribute = {
1: 'a',
5: 'e',
}
class B(A):
attribute = A.attribute.copy()
attribute[6] = 'f'
print(A.attribute) # -> {1: 'a', 5: 'e'}
print(B.attribute) # -> {1: 'a', 5: 'e', 6: 'f'}
</code></pre>