match_args: If true (the default is True), the [__match_args__](https://docs.python.org/3.14/reference/datamodel.html#object.__match_args__)
tuple will be created from the list of parameters to the generated
[__init__()](https://docs.python.org/3.14/reference/datamodel.html#object.__init__)
method (even if __init__() is not generated, see above).
If false, or if __match_args__ is already defined in the class,
then __match_args__ will not be generated.
Bug report
Documentation
Docs right now: https://docs.python.org/3.14/library/dataclasses.html#dataclasses.dataclass
But, in runtime this does not work this way:
It only add non-kw-only params here:
cpython/Lib/dataclasses.py
Lines 1174 to 1177 in 895d983
cpython/Lib/dataclasses.py
Lines 411 to 417 in 895d983
Found while working on python/mypy#18892
I have a PR ready.
Thanks to @sterliakov!
Linked PRs
__match_args__generation docs indataclasses.rst#132222__match_args__generation docs indataclasses.rst(GH-132222) #132226__match_args__generation docs indataclasses.rst(GH-132222) #132227