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

Guido van Rossum guido@python.org
Thu, 19 Sep 2002 16:06:56 -0400


> > Sorry, I may have missed that suggestion amidst your rhetoric.
> >
> > Assuming you're lobbying for a builtin named copy(), should it be a
> > deep copy or a shallow copy?
> 
> Is this question a red herring, Guido? Surely one would ask for both
> copy() and deepcopy(), the same functions exposed by the copy
> module. Of course, I'm not convinced having them as builtins solves
> the real problem. (Which is why I asked if the question was a red
> herring.) If anything, having these functions as builtins might lead
> to an excessive use of copying by the same individuals who hadn't
> yet gotten a handle on mutable versus immutable objects.

Exactly.  I'm trying to tease out what Arthur perceived the solution
to be to the surprises with object aliasing.

--Guido van Rossum (home page: http://www.python.org/~guido/)