Python: copy.deepcopy produces an error
<p>I have been using this copy method for quite a while, in lots of classes that needed it.</p>

<pre><code>class population (list):
def __init__ (self):
    pass

def copy(self):
    return copy.deepcopy(self)
</code></pre>

<p>It has suddenly started producing this error:</p>

<pre><code>     File "C:\Python26\lib\copy.py", line 338, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Python26\lib\copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "C:\Python26\lib\copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Python26\lib\copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python26\lib\copy.py", line 323, in _reconstruct
    y = callable(*args)
  File "C:\Python26\lib\copy_reg.py", line 93, in __newobj__
    return cls.__new__(cls, *args)
TypeError: object.__new__(generator) is not safe, use generator.__new__()
&gt;&gt;&gt;
</code></pre>

<p>the lines which include the references to lines 338, 162, 255, 189 were repeated quite a few times before the 'line 338' that I copied here.</p>
