@@ -88,27 +88,36 @@ pickle functions from the :mod:`copyreg` module.
8888   single: __deepcopy__() (copy protocol)
8989
9090In order for a class to define its own copy implementation, it can define
91- special methods :meth: `__copy__ ` and :meth: `__deepcopy__ `.  The former is called
92- to implement the shallow copy operation; no additional arguments are passed.
93- The latter is called to implement the deep copy operation; it is passed one
94- argument, the ``memo `` dictionary.  If the :meth: `__deepcopy__ ` implementation needs
95- to make a deep copy of a component, it should call the :func: `deepcopy ` function
96- with the component as first argument and the memo dictionary as second argument.
97- The memo dictionary should be treated as an opaque object.
91+ special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
92+ 
93+ .. method :: object.__copy__(self) 
94+    :noindexentry: 
95+ 
96+    Called to implement the shallow copy operation;
97+    no additional arguments are passed.
98+ 
99+ .. method :: object.__deepcopy__(self, memo) 
100+    :noindexentry: 
101+ 
102+    Called to implement the deep copy operation; it is passed one
103+    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
105+    with the component as first argument and the *memo * dictionary as second argument.
106+    The *memo * dictionary should be treated as an opaque object.
98107
99108
100109.. index ::
101110   single: __replace__() (replace protocol)
102111
103112Function :func: `replace ` is more limited than :func: `copy ` and :func: `deepcopy `,
104113and only supports named tuples created by :func: `~collections.namedtuple `,
105- :mod: `dataclasses `, and other classes which define method :meth: `! __replace__ `.
114+ :mod: `dataclasses `, and other classes which define method :meth: `~object. __replace__ `.
106115
107-     .. method :: __replace__(self, /, **changes) 
108-        :noindex :
116+ .. method :: object. __replace__(self, /, **changes)
117+    :noindexentry :
109118
110- :meth: ` !__replace__ `  should create a new object of the same type,
111- replacing fields with values from *changes *.
119+    This method  should create a new object of the same type,
120+     replacing fields with values from *changes *.
112121
113122
114123.. seealso ::
0 commit comments