]> granicus.if.org Git - python/commitdiff
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 24 Aug 2019 18:33:18 +0000 (11:33 -0700)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 24 Aug 2019 18:33:18 +0000 (11:33 -0700)
(cherry picked from commit 69ee87e99cfe0b79389cffa92d126af868baf353)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/copy.rst
Doc/tutorial/introduction.rst

index c7bd89f96372264689a69938bed6c56bc8922a8c..a8e8bfb1e832bb2dc569ff04edd27c731a28b3f0 100644 (file)
@@ -31,6 +31,7 @@ Interface summary:
 
    Raised for module specific errors.
 
+.. _shallow_vs_deep_copy:
 
 The difference between shallow and deep copying is only relevant for compound
 objects (objects that contain other objects, like lists or class instances):
index a4dbd6351b77d8e7871912c7317bf75dba876333..2a1666128a20155cb38e3fbdc3c255b7d38a31a6 100644 (file)
@@ -394,7 +394,8 @@ indexed and sliced::
    [9, 16, 25]
 
 All slice operations return a new list containing the requested elements.  This
-means that the following slice returns a new (shallow) copy of the list::
+means that the following slice returns a
+:ref:`shallow copy <shallow_vs_deep_copy>` of the list::
 
    >>> squares[:]
    [1, 4, 9, 16, 25]