diff options
-rw-r--r-- | Doc/library/copy.rst | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index e6ad857..5ae79aa9 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -4,21 +4,25 @@ .. module:: copy :synopsis: Shallow and deep copy operations. +This module provides generic (shallow and deep) copying operations. -.. index:: - single: copy() (in copy) - single: deepcopy() (in copy) -This module provides generic (shallow and deep) copying operations. +Interface summary: + +.. function:: copy(x) + + Return a shallow copy of *x*. + + +.. function:: deepcopy(x) + + Return a deep copy of *x*. -Interface summary:: - import copy +.. exception:: error - x = copy.copy(y) # make a shallow copy of y - x = copy.deepcopy(y) # make a deep copy of y + Raised for module specific errors. -For module specific errors, :exc:`copy.error` is raised. The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances): |