File tree 2 files changed +16
-8
lines changed
2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,22 @@ pickle functions from the :mod:`copyreg` module.
80
80
single: __deepcopy__() (copy protocol)
81
81
82
82
In order for a class to define its own copy implementation, it can define
83
- special methods :meth: `__copy__ ` and :meth: `__deepcopy__ `. The former is called
84
- to implement the shallow copy operation; no additional arguments are passed.
85
- The latter is called to implement the deep copy operation; it is passed one
86
- argument, the ``memo `` dictionary. If the :meth: `__deepcopy__ ` implementation needs
87
- to make a deep copy of a component, it should call the :func: `deepcopy ` function
88
- with the component as first argument and the memo dictionary as second argument.
89
- The memo dictionary should be treated as an opaque object.
83
+ special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
84
+
85
+ .. method :: object.__copy__(self)
86
+ :noindexentry:
87
+
88
+ Called to implement the shallow copy operation;
89
+ no additional arguments are passed.
90
+
91
+ .. method :: object.__deepcopy__(self, memo)
92
+ :noindexentry:
93
+
94
+ Called to implement the deep copy operation; it is passed one
95
+ argument, the *memo * dictionary. If the ``__deepcopy__ `` implementation needs
96
+ to make a deep copy of a component, it should call the :func: `deepcopy ` function
97
+ with the component as first argument and the *memo * dictionary as second argument.
98
+ The *memo * dictionary should be treated as an opaque object.
90
99
91
100
92
101
.. seealso ::
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ Doc/library/asyncio-policy.rst
21
21
Doc/library/audioop.rst
22
22
Doc/library/cgi.rst
23
23
Doc/library/chunk.rst
24
- Doc/library/copy.rst
25
24
Doc/library/decimal.rst
26
25
Doc/library/email.charset.rst
27
26
Doc/library/email.compat32-message.rst
You can’t perform that action at this time.
0 commit comments