From 69ee87e99cfe0b79389cffa92d126af868baf353 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 24 Aug 2019 11:15:44 -0700 Subject: [PATCH] bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) --- Doc/library/copy.rst | 1 + Doc/tutorial/introduction.rst | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index c7bd89f963..a8e8bfb1e8 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 a4dbd6351b..2a1666128a 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 ` of the list:: >>> squares[:] [1, 4, 9, 16, 25] -- 2.40.0