[Python-Dev] Re: [ python-Bugs-416670 ] MatchObjects not deepcopy()able

Fredrik Lundh fredrik@pythonware.com
Fri, 27 Apr 2001 11:06:37 +0200


tim wrote:
> It's a std way to get a clone of an object, and when you don't want mutations
> of the clone to have any effect on the original (or vice versa).  Perhaps if
> I call it the Clone Pattern, people will assume that makes it a good thing
> and cut that part of the debate mercifully short <wink>.

which leads to a followup question: the current approach
seems to be to hack the copy.py file for each and every
type.  imo, that's rather unpythonic, and also introduces
lots of unnecessary module dependencies.

time to add a __clone__ slot?

or could someone who knows what he's doing here address
this comment in copy.py:

    # XXX need to support copy_reg here too...

Cheers /F