@@ -88,20 +88,22 @@ pickle functions from the :mod:`copyreg` module.
88
88
single: __deepcopy__() (copy protocol)
89
89
90
90
In order for a class to define its own copy implementation, it can define
91
- special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
91
+ special methods :meth: `~builtins. object.__copy__ ` and :meth: `~builtins. object.__deepcopy__ `.
92
92
93
93
.. method :: object.__copy__(self)
94
+ :module: builtins
94
95
:noindexentry:
95
96
96
97
Called to implement the shallow copy operation;
97
98
no additional arguments are passed.
98
99
99
100
.. method :: object.__deepcopy__(self, memo)
101
+ :module: builtins
100
102
:noindexentry:
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
@@ -111,9 +113,10 @@ special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`.
111
113
112
114
Function :func: `replace ` is more limited than :func: `copy ` and :func: `deepcopy `,
113
115
and only supports named tuples created by :func: `~collections.namedtuple `,
114
- :mod: `dataclasses `, and other classes which define method :meth: `~object.__replace__ `.
116
+ :mod: `dataclasses `, and other classes which define method :meth: `~builtins. object.__replace__ `.
115
117
116
118
.. method :: object.__replace__(self, /, **changes)
119
+ :module: builtins
117
120
:noindexentry:
118
121
119
122
This method should create a new object of the same type,
0 commit comments