[Python-checkins] bpo-14112: Allow beginners to explore shallowness in greater depth ; -) (GH-15465)

Raymond Hettinger webhook-mailer at python.org
Sat Aug 24 14:15:48 EDT 2019


https://github.com/python/cpython/commit/69ee87e99cfe0b79389cffa92d126af868baf353
commit: 69ee87e99cfe0b79389cffa92d126af868baf353
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-08-24T11:15:44-07:00
summary:

bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465)

files:
M Doc/library/copy.rst
M Doc/tutorial/introduction.rst

diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst
index c7bd89f96372..a8e8bfb1e832 100644
--- a/Doc/library/copy.rst
+++ b/Doc/library/copy.rst
@@ -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):
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index a4dbd6351b77..2a1666128a20 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -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]



More information about the Python-checkins mailing list