Skip to content

Commit f24987d

Browse files
committed
pythongh-109961: Use proper module for copy method docs
1 parent 9be283e commit f24987d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Doc/library/copy.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,22 @@ pickle functions from the :mod:`copyreg` module.
8888
single: __deepcopy__() (copy protocol)
8989

9090
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__`.
9292

9393
.. method:: object.__copy__(self)
94+
:module: builtins
9495
:noindexentry:
9596

9697
Called to implement the shallow copy operation;
9798
no additional arguments are passed.
9899

99100
.. method:: object.__deepcopy__(self, memo)
101+
:module: builtins
100102
:noindexentry:
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

@@ -111,9 +113,10 @@ special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`.
111113

112114
Function :func:`replace` is more limited than :func:`copy` and :func:`deepcopy`,
113115
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__`.
115117

116118
.. method:: object.__replace__(self, /, **changes)
119+
:module: builtins
117120
:noindexentry:
118121

119122
This method should create a new object of the same type,

0 commit comments

Comments
 (0)