Skip to content

Commit f1b1680

Browse files
sobolevnAA-Turner
andauthored
gh-109961: Use proper module for copy method docs (#110027)
Co-authored-by: Adam Turner <[email protected]>
1 parent d102d39 commit f1b1680

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Doc/library/copy.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
9092
In order for a class to define its own copy implementation, it can define
9193
special 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`,
113116
and only supports named tuples created by :func:`~collections.namedtuple`,
114117
:mod:`dataclasses`, and other classes which define method :meth:`~object.__replace__`.
115118

0 commit comments

Comments
 (0)