]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Tweak wording for dataclasses.replace (gh-117758) (#117876)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 14 Apr 2024 16:52:44 +0000 (18:52 +0200)
committerGitHub <noreply@github.com>
Sun, 14 Apr 2024 16:52:44 +0000 (16:52 +0000)
(cherry picked from commit e7cce2a9c696250aff64a57b85182356367be041)

Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
Doc/library/dataclasses.rst

index 95b746d81dfde68e6b7314bcfb2aca38a526aed2..d62011cee1b111000041b21757ded82d05e1b53e 100644 (file)
@@ -430,8 +430,8 @@ Module contents
 
    Creates a new object of the same type as ``obj``, replacing
    fields with values from ``changes``.  If ``obj`` is not a Data
-   Class, raises :exc:`TypeError`.  If values in ``changes`` do not
-   specify fields, raises :exc:`TypeError`.
+   Class, raises :exc:`TypeError`.  If keys in ``changes`` are not
+   field names of the given dataclass, raises :exc:`TypeError`.
 
    The newly returned object is created by calling the :meth:`~object.__init__`
    method of the dataclass.  This ensures that