8000 gh-108751: Add copy.replace() function by serhiy-storchaka · Pull Request #108752 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108751: Add copy.replace() function #108752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Doc/library/copy.rst.
  • Loading branch information
serhiy-storchaka committed Sep 1, 2023
commit 989d565a91ba74dd3d31ee89ac7d48a80a5f920b
4 changes: 2 additions & 2 deletions Doc/library/copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ The memo dictionary should be treated as an opaque object.
single: __replace__() (replace protocol)

Function :func:`replace` is more limited than :func:`copy` and :func:`deepcopy`,
and only supports named tuples, dataclasses, and other classes which
define method :meth:`!__replace__`.
and only supports named tuples created by :func:`~collections.namedtuple`,
:mod:`dataclasses`, and other classes which define method :meth:`!__replace__`.

.. method:: __replace__(self, /, **changes)
:noindex:
Expand Down
0