]> granicus.if.org Git - python/commitdiff
Merged revisions 74737 via svnmerge from
authorGeorg Brandl <georg@python.org>
Wed, 9 Sep 2009 16:51:05 +0000 (16:51 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 9 Sep 2009 16:51:05 +0000 (16:51 +0000)
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.
........

Doc/library/copy.rst

index e6ad857a7324a75f380470d34950f2d338df72f9..5ae79aa91d1c7bd99bcc7243cc553922faa60037 100644 (file)
@@ -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):