[Edu-sig] Elegant copy-by-value

Arthur Arthur" <ajs@ix.netcom.com
Mon, 13 Jan 2003 09:19:36 -0500


A recent thread on python-list re-raises copy and deepcopy becoming
built-in.

It is controversial, to be sure.  But there doen't seem to be any sentiment
that the idea is *fundamentally* unsound.

Nor does the thread even touch on the reasons that I, for example, think it
to be important.  If my argument has any weight, and the idea is not unsound
even without consideration of it, well....


http://groups.google.com/groups?dq=&num=25&hl=en&lr=&ie=UTF-8&group=comp.lan
g.python&start=25

> >If it still bothers you, how about a PEP proposing that object have
> >copy and deepcopy methods that DTRT? That way, all new-style classes
> >would have a copy and deepcopy methods, so you could invoke them
> >without having to import a module.
>
> Actually, I think Python could get what he wants if copy.copy and
> copy.deepcopy were added to the builtins as 'copy' and 'deepcopy'.
> It seems he mostly didn't like the need for an extra import, based
> on the OP's statement