File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 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.
8787 single: __copy__() (copy protocol)
8888 single: __deepcopy__() (copy protocol)
8989
90+ .. currentmodule :: None
91+
9092In order for a class to define its own copy implementation, it can define
9193special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
9294
@@ -101,15 +103,16 @@ special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`.
101103
102104 Called to implement the deep copy operation; it is passed one
103105 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
105107 with the component as first argument and the *memo * dictionary as second argument.
106108 The *memo * dictionary should be treated as an opaque object.
107109
108110
109111.. index ::
110112 single: __replace__() (replace protocol)
111113
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 `,
113116and only supports named tuples created by :func: `~collections.namedtuple `,
114117:mod: `dataclasses `, and other classes which define method :meth: `~object.__replace__ `.
115118
You can’t perform that action at this time.
0 commit comments