Terry J. Reedy <tjre...@udel.edu> added the comment:

'Shallow' is a common English word: "Stay in shallow water until you learn to 
swim!" But that is not the issue here.

I think the underlying issue is that the first sentence "All slice operations 
return a new list containing the requested elements." is wrong. Python lists, 
like shopping lists, do not 'contain' objects. Both contain references to 
objects (copies of their identifieres) and thereby define an abstract 
collection. A shallow copy of a collection object copies references (ids). A 
deep copy also copies objects themselves. (The Wikipedia article says much the 
same, but to me much less clearly.) 

If we start with a true sentence "Slice operations return a new list containing 
references to a subsequence of the original elements." or "Slice operations 
return a new list that defines a subsequence of the original sequence of 
objects", then I do not think more *needs* to be said. We could optionally add 
"Since no objects are copied, slices are shallow copies." both to emphasize 
that no objects are copied and to introduced the notion of shallow copy.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14112>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to