Message154290
'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. |
|
Date |
User |
Action |
Args |
2012-02-26 00:12:04 | terry.reedy | set | recipients:
+ terry.reedy, tim.golden, ned.deily, ezio.melotti, eric.araujo, docs@python, tshepang, Ramchandra Apte |
2012-02-26 00:12:04 | terry.reedy | set | messageid: <1330215124.9.0.232389966166.issue14112@psf.upfronthosting.co.za> |
2012-02-26 00:12:04 | terry.reedy | link | issue14112 messages |
2012-02-26 00:12:04 | terry.reedy | create | |
|