diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index 63fe823f633..7031826526b 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -80,13 +80,22 @@ pickle functions from the :mod:`copyreg` module. single: __deepcopy__() (copy protocol) In order for a class to define its own copy implementation, it can define -special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called -to implement the shallow copy operation; no additional arguments are passed. -The latter is called to implement the deep copy operation; it is passed one -argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs -to make a deep copy of a component, it should call the :func:`deepcopy` function -with the component as first argument and the memo dictionary as second argument. -The memo dictionary should be treated as an opaque object. +special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`. + +.. method:: object.__copy__(self) + :noindexentry: + + Called to implement the shallow copy operation; + no additional arguments are passed. + +.. method:: object.__deepcopy__(self, memo) + :noindexentry: + + Called to implement the deep copy operation; it is passed one + argument, the *memo* dictionary. If the ``__deepcopy__`` implementation needs + to make a deep copy of a component, it should call the :func:`deepcopy` function + with the component as first argument and the *memo* dictionary as second argument. + The *memo* dictionary should be treated as an opaque object. .. seealso:: diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 293cc7f3867..6891a725ecb 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -21,7 +21,6 @@ Doc/library/asyncio-policy.rst Doc/library/audioop.rst Doc/library/cgi.rst Doc/library/chunk.rst -Doc/library/copy.rst Doc/library/decimal.rst Doc/library/email.charset.rst Doc/library/email.compat32-message.rst