Skip to content

Commit

Permalink
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger authored Aug 24, 2019
1 parent fa7a6f5 commit 69ee87e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Doc/library/copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion Doc/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 69ee87e

Please sign in to comment.