title: Why doesn't deepcopy of classes preserve attributes?
body: <p>In the example below, I am deepcopying a base class and messing with the attributes of the copy. Why is this messing with the attributes of the original class? Is there any way to avoid this? The current code structure I am working with can't support multiple inheritance, so I really want to be able to somehow copy the class. </p>
  
  <pre><code>&gt;&gt;&gt; class Base(object):
  ...    foo = "bar"
  ... 
  &gt;&gt;&gt; base_copy = copy.deepcopy(Base)
  &gt;&gt;&gt; del base_copy.foo
  &gt;&gt;&gt; 
  &gt;&gt;&gt; base_again = copy.deepcopy(Base)
  &gt;&gt;&gt; hasattr(base_again, 'foo')
  False
  &gt;&gt;&gt; 
  </code></pre>