File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ pickle functions from the :mod:`copyreg` module.
87
87
single: __copy__() (copy protocol)
88
88
single: __deepcopy__() (copy protocol)
89
89
90
+ .. currentmodule :: None
91
+
90
92
In order for a class to define its own copy implementation, it can define
91
93
special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
92
94
@@ -101,15 +103,16 @@ special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`.
101
103
102
104
Called to implement the deep copy operation; it is passed one
103
105
argument, the *memo * dictionary. If the ``__deepcopy__ `` implementation needs
104
- to make a deep copy of a component, it should call the :func: `deepcopy ` function
106
+ to make a deep copy of a component, it should call the :func: `~copy. deepcopy ` function
105
107
with the component as first argument and the *memo * dictionary as second argument.
106
108
The *memo * dictionary should be treated as an opaque object.
107
109
108
110
109
111
.. index ::
110
112
single: __replace__() (replace protocol)
111
113
112
- Function :func: `replace ` is more limited than :func: `copy ` and :func: `deepcopy `,
114
+ Function :func: `!copy.replace ` is more limited
115
+ than :func: `~copy.copy ` and :func: `~copy.deepcopy `,
113
116
and only supports named tuples created by :func: `~collections.namedtuple `,
114
117
:mod: `dataclasses `, and other classes which define method :meth: `~object.__replace__ `.
115
118
You can’t perform that action at this time.
0 commit comments