@@ -164,7 +164,7 @@ Module contents
164
164
165
165
- *match_args *: If true (the default is ``True ``), the
166
166
:attr: `~object.__match_args__ ` tuple will be created from the list of
167
- parameters to the generated :meth: `~object.__init__ ` method (even if
167
+ non keyword-only parameters to the generated :meth: `~object.__init__ ` method (even if
168
168
:meth: `!__init__ ` is not generated, see above). If false, or if
169
169
:attr: `!__match_args__ ` is already defined in the class, then
170
170
:attr: `!__match_args__ ` will not be generated.
@@ -175,11 +175,12 @@ Module contents
175
175
fields will be marked as keyword-only. If a field is marked as
176
176
keyword-only, then the only effect is that the :meth: `~object.__init__ `
177
177
parameter generated from a keyword-only field must be specified
178
- with a keyword when :meth: `!__init__ ` is called. There is no
179
- effect on any other aspect of dataclasses. See the
180
- :term: `parameter ` glossary entry for details. Also see the
178
+ with a keyword when :meth: `!__init__ ` is called. See the :term: `parameter `
179
+ glossary entry for details. Also see the
181
180
:const: `KW_ONLY ` section.
182
181
182
+ Keyword-only fields are not included in :attr: `!__match_args__ `.
183
+
183
184
.. versionadded :: 3.10
184
185
185
186
- *slots *: If true (the default is ``False ``), :attr: `~object.__slots__ ` attribute
@@ -306,6 +307,8 @@ Module contents
306
307
This is used when the generated :meth: `~object.__init__ ` method's
307
308
parameters are computed.
308
309
310
+ Keyword-only fields are also not included in :attr: `!__match_args__ `.
311
+
309
312
.. versionadded :: 3.10
310
313
311
314
If the default value of a field is specified by a call to
0 commit comments