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

(cherry picked from commit 69ee87e99c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2019-08-24 11:33:18 -07:00 committed by Raymond Hettinger
parent d5a66bc56f
commit a8424940b4
2 changed files with 3 additions and 1 deletions

View 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):

View 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]