summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric V. Smith <ericvsmith@users.noreply.github.com>2021-05-02 01:46:05 (GMT)
committerGitHub <noreply@github.com>2021-05-02 01:46:05 (GMT)
commit318ca1764ca02692e19e5ea05078281b93c8106a (patch)
tree19ce373e7aee525376791093ae5183e70392da32
parent2f59a767bcf5bfd51cfe712b35f8eb9b3ea08e2f (diff)
downloadcpython-318ca1764ca02692e19e5ea05078281b93c8106a.zip
cpython-318ca1764ca02692e19e5ea05078281b93c8106a.tar.gz
cpython-318ca1764ca02692e19e5ea05078281b93c8106a.tar.bz2
Minor tweaks to dataclasses keyword-only fields documentation. (GH-25801)
-rw-r--r--Doc/library/dataclasses.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index 3808eba..87091ef 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -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