title: How to reset class variables properly across instantiations
body: <p>dict class variable is preserved across inheritance and instantiation:</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; class Superclass:
  ...   x = {'one': 1}
  ...   def __init__(self):
  ...     self.x['one'] += 1
  ... 
  &gt;&gt;&gt; class Subclass(Superclass):
  ...   def __init__(self):
  ...     super().__init__()
  ... 
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 3}
  &gt;&gt;&gt; Subclass().x
  {'one': 4}
  &gt;&gt;&gt; Subclass().x
  {'one': 5}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 7}
  </code></pre>
  <p>How can I force <code>Superclass</code> to use a fresh dict every time it is instantiated, I would expect:</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; class Superclass:
  ...   x = {'one': 1}
  ...   def __init__(self):
  ...     self.x['one'] += 1
  ... 
  &gt;&gt;&gt; class Subclass(Superclass):
  ...   def __init__(self):
  ...     super().__init__()
  ... 
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  </code></pre>
  <p>And also</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; class Superclass:
  ...   x = {'one': 1}
  ...   def __init__(self):
  ...     self.x['one'] += 1
  ... 
  &gt;&gt;&gt; class Subclass(Superclass):
  ...   x = {'one': 5}
  ...   def __init__(self):
  ...     super().__init__()
  ... 
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  &gt;&gt;&gt; Subclass().x
  {'one': 6}
  </code></pre>
  <p>Having an instance variable obviously doesn't work:</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; class Superclass:
  ...   def __init__(self):
  ...     self.x = {'one': 1}
  ...     self.x['one'] += 1
  ... 
  &gt;&gt;&gt; class Subclass(Superclass):
  ...   def __init__(self):
  ...     self.x = {'one': 5}
  ...     super().__init__()
  ... 
  &gt;&gt;&gt; Subclass().x # desired: {'one': 6}
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  &gt;&gt;&gt; Subclass().x
  {'one': 2}
  </code></pre>
  <p>A mixture doesn't work for when the superclass is reinstantiated:</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; class Superclass:
  ...   x = {'one': 1}
  ...   def __init__(self):
  ...     self.x['one'] += 1
  ... 
  &gt;&gt;&gt; class Subclass(Superclass):
  ...   def __init__(self):
  ...     self.x = {'one': 5}
  ...     super().__init__()
  ... 
  &gt;&gt;&gt; Superclass().x
  {'one': 2}
  &gt;&gt;&gt; Superclass().x
  {'one': 3}
  &gt;&gt;&gt; Superclass().x
  {'one': 4}
  &gt;&gt;&gt; Superclass().x
  {'one': 5}
  &gt;&gt;&gt; Superclass().x
  {'one': 6}
  &gt;&gt;&gt; Superclass().x
  {'one': 7}
  </code></pre>
  <p>What's a correct and established way to solve this problem?</p>