What makes an object uncopyable?

Konstantin Veretennicov kveretennicov at gmail.com
Sat Jun 18 14:50:37 EDT 2005


On 17 Jun 2005 15:41:07 -0700, tron.thomas at verizon.net
<tron.thomas at verizon.net> wrote:
> I am trying to make a copy of a certain Python object using the
> copy.copy() function.  When I try to perform this operation I get an
> error like the following:
> 
> copy.Error: un(shallow)copyable object of type ...
> 
> What factors determine whether an object can be copied?

You are probably trying to copy an instance of a class implemented in
C extension. AFAIK, Python classes have copy support by default, but
extension classes need to implement copy/pickle protocol.

- kv



More information about the Python-list mailing list