A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-April/014461.html below:

[ python-Bugs-416670 ] MatchObjects not deepcopy()able

[Python-Dev] Re: [ python-Bugs-416670 ] MatchObjects not deepcopy()able [Python-Dev] Re: [ python-Bugs-416670 ] MatchObjects not deepcopy()ableTim Peters tim.one@home.com
Thu, 26 Apr 2001 19:52:55 -0400
[/F]
> thought I'd check this one with python-dev before marking
> it as "won't fix".  I cannot see any reason why anyone would
> even attempt to deepcopy match objects...

Likely just because they're part of other objects, like bound to instance
attributes, or members of lists.  No matter how deep they're buried, someone
trying to deepcopy a container will eventually need to deepcopy them too.

> (cannot see any reason why anyone would use deepcopy for
> anything, but that's another story)

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>.

It's *nice* to supply a deepcopy operation whenever it's doable with
reasonable effort.  I agree you're not required to in this case -- but it
would still be "nice", if that's feasible.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4