[New-bugs-announce] [issue43764] Turning off generation of __match_args__ for dataclasses

Adrian Freund report at bugs.python.org
Wed Apr 7 09:07:21 EDT 2021

New submission from Adrian Freund <git at freundtech.com>:

The dataclass decorator can take multiple parameters to enable or disable the generation of certain methods.

PEP 634 Structural Pattern Matching extends dataclasses to also generate a __match_args__ attribute.

I think adding a parameter to enable and disable generation of __match_args__ should be to dataclass should also be considered for consistency.

Note that setting compare=False on a dataclass.field already excludes that field from __match_args__, but there is no way to disable generation of __match_args__ completely.

components: Library (Lib)
messages: 390429
nosy: brandtbucher, eric.smith, freundTech, gvanrossum
priority: normal
severity: normal
status: open
title: Turning off generation of __match_args__ for dataclasses
versions: Python 3.10

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list