This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brandtbucher
Recipients brandtbucher, eric.smith, freundTech, gvanrossum
Date 2021-04-07.17:41:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617817308.41.0.636387345178.issue43764@roundup.psfhosted.org>
In-reply-to
Content
I agree with Eric. You can already disable the automatic creation of __match_args__ by setting it yourself on the class being decorated, and "__match_args__ = ()" will make the class behave the exact same as if __match_args__ is not defined at all.

>>> from dataclasses import dataclass
>>> @dataclass 
... class X:
...     __match_args__ = ()
...     a: int
...     b: int
...     c: int
... 
>>> X.__match_args__
()

I too have trouble imagining a case where the actual *presence* of the attribute matters. But assuming those cases exist, wouldn't a simple "del X.__match_args__" suffice?
History
Date User Action Args
2021-04-07 17:41:48brandtbuchersetrecipients: + brandtbucher, gvanrossum, eric.smith, freundTech
2021-04-07 17:41:48brandtbuchersetmessageid: <1617817308.41.0.636387345178.issue43764@roundup.psfhosted.org>
2021-04-07 17:41:48brandtbucherlinkissue43764 messages
2021-04-07 17:41:48brandtbuchercreate