]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor tweaks to dataclasses keyword-only fields documentation. (GH-25801)
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Sun, 2 May 2021 01:46:05 +0000 (21:46 -0400)
committerGitHub <noreply@github.com>
Sun, 2 May 2021 01:46:05 +0000 (21:46 -0400)
Doc/library/dataclasses.rst

index 3808eba1941d5585106794e2bdae883d3e2193ab..87091ef819d8943350e7da7a69eb7da300ef9405 100644 (file)
@@ -537,11 +537,11 @@ The generated :meth:`__init__` method for ``C`` will look like::
 
   def __init__(self, x: int = 15, y: int = 0, z: int = 10):
 
-Re-ordering of keyword-only parameters in __init__
---------------------------------------------------
+Re-ordering of keyword-only parameters in :meth:`__init__`
+----------------------------------------------------------
 
 After the parameters needed for :meth:`__init__` are computed, any
-keyword-only parameters are moved to come after regular
+keyword-only parameters are moved to come after all regular
 (non-keyword-only) fields.  In this example, ``Base.y``, ``Base.w``,
 and ``D.t`` are keyword-only fields, and ``Base.x`` and ``D.z`` are
 regular fields::
@@ -566,8 +566,8 @@ Note that the parameters have been re-ordered from how they appear in
 the list of fields: parameters derived from regular fields are
 followed by parameters derived from keyword-only fields.
 
-The relative ordering of keyword-only parameters is not changed from
-the order they are in computed field :meth:`__init__` list.
+The relative ordering of keyword-only parameters is maintained in the
+re-ordered :meth:`__init__` parameter list.
 
 
 Default factory functions