why extending copy.*

Uwe Mayer merkosh at hadiko.de
Fri Jun 21 15:07:35 CEST 2002


hi,

i need shallow and deep copies of objects and I found the copy module in 
the reference library which does quite a good job.
however, they write that one could implement the copy protocol by 
extending/ overwriting the __copy__() and __deepcopy__() method.

since __copy__() and __deepcopy__() already duplicate the instance 
dictionary, __deepcopy__() even recursively. For what reasons would I 
want to extend /overwrite the capabilities of __copy__() or __deepcopy__
()?



More information about the Python-list mailing list