diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-24 18:33:18 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-08-24 18:33:18 (GMT) |
commit | a8424940b4873791fc178a9f19a7bf1779a6cf42 (patch) | |
tree | 2289190096f54ad0b05b52a433aac1f788913f8c | |
parent | d5a66bc56f68d0f7cc3470722a31d7f731754af6 (diff) | |
download | cpython-a8424940b4873791fc178a9f19a7bf1779a6cf42.zip cpython-a8424940b4873791fc178a9f19a7bf1779a6cf42.tar.gz cpython-a8424940b4873791fc178a9f19a7bf1779a6cf42.tar.bz2 |
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) (GH-15469)
(cherry picked from commit 69ee87e99cfe0b79389cffa92d126af868baf353)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
-rw-r--r-- | Doc/library/copy.rst | 1 | ||||
-rw-r--r-- | Doc/tutorial/introduction.rst | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index c7bd89f..a8e8bfb 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 a4dbd63..2a16661 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] |