[Edu-sig] Fw: Python sequences by reference - how to make

Arthur ajs@ix.netcom.com
Fri, 20 Sep 2002 11:42:00 -0400


Guido writes -

>What Kirby describes can be had by doing

>    >>> from copy import copy, deepcopy

Which is obviously why I can't come up with a code example for my position.
If wel are willing to make that the answer there is clearly nothing to
discuss.

>copy() nor deepcopy() is a built-in, because it is a potentially
>expensive operation, and I feel that its presence as a built-in would
>cause beginning and intermediate programmers to overuse it.

My only counter argument is that this decision was made when Python had
much, much fewer very,very specialized libraries. The expectation/perception
of what it means to import a library module has evolved to the point to
where it is counter-intututive to expect to need to import functionality
like that added by copy - IMO.

But my argument is circular in some sense - because I am contending that
copy represents core functionality, or more accurately, a core conceptual
idea.

I am emphasizing *that*  -  the conceptual clues that one is given by seeing
copy as a built-in, and you are emphasizing other concerns.  I understand
that you are often in the trade-off business - and I guess there is no harm
in having some disagreement as to where the trade-offs might fall at this
particular stage of the game.

Art