diff options
Diffstat (limited to 'Doc/library/copy.rst')
-rw-r--r-- | Doc/library/copy.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index 2041d91..c7bd89f 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -22,7 +22,7 @@ Interface summary: Return a shallow copy of *x*. -.. function:: deepcopy(x) +.. function:: deepcopy(x[, memo]) Return a deep copy of *x*. @@ -52,7 +52,7 @@ copy operations: The :func:`deepcopy` function avoids these problems by: -* keeping a "memo" dictionary of objects already copied during the current +* keeping a ``memo`` dictionary of objects already copied during the current copying pass; and * letting user-defined classes override the copying operation or the set of @@ -82,7 +82,7 @@ In order for a class to define its own copy implementation, it can define special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one -argument, the memo dictionary. If the :meth:`__deepcopy__` implementation needs +argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs to make a deep copy of a component, it should call the :func:`deepcopy` function with the component as first argument and the memo dictionary as second argument. |