summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-09 16:51:05 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-09 16:51:05 (GMT)
commita59750f4d6decf2de11aeea0f29b44da1f0547f8 (patch)
tree833e1b866bb8922529b8b071e911c2b0ba9df0a7 /Doc/library
parent165581cb3601f1754ce0e8e89953b896f3f1f281 (diff)
downloadcpython-a59750f4d6decf2de11aeea0f29b44da1f0547f8.zip
cpython-a59750f4d6decf2de11aeea0f29b44da1f0547f8.tar.gz
cpython-a59750f4d6decf2de11aeea0f29b44da1f0547f8.tar.bz2
Merged revisions 74737 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74737 | georg.brandl | 2009-09-09 18:49:13 +0200 (Mi, 09 Sep 2009) | 1 line Properly document copy and deepcopy as functions. ........
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/copy.rst22
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):