]> granicus.if.org Git - python/commitdiff
Properly document copy and deepcopy as functions.
authorGeorg Brandl <georg@python.org>
Wed, 9 Sep 2009 16:49:13 +0000 (16:49 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 9 Sep 2009 16:49:13 +0000 (16:49 +0000)
Doc/library/copy.rst

index 89b668d5f9f09ecd9fe10d49517d89f246a6e748..b3ce51f57e40dc61ec0d9fdbd666bab2280d1f03 100644 (file)
@@ -1,25 +1,28 @@
-
 :mod:`copy` --- Shallow and deep copy operations
 ================================================
 
 .. 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):