[Python-checkins] r74737 - python/trunk/Doc/library/copy.rst

georg.brandl python-checkins at python.org
Wed Sep 9 18:49:13 CEST 2009


Author: georg.brandl
Date: Wed Sep 9 18:49:13 2009
New Revision: 74737
Log:
Properly document copy and deepcopy as functions.
Modified:
 python/trunk/Doc/library/copy.rst
Modified: python/trunk/Doc/library/copy.rst
==============================================================================
--- python/trunk/Doc/library/copy.rst	(original)
+++ python/trunk/Doc/library/copy.rst	Wed Sep 9 18:49:13 2009
@@ -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):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /