Message390453
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? |
|
Date |
User |
Action |
Args |
2021-04-07 17:41:48 | brandtbucher | set | recipients:
+ brandtbucher, gvanrossum, eric.smith, freundTech |
2021-04-07 17:41:48 | brandtbucher | set | messageid: <1617817308.41.0.636387345178.issue43764@roundup.psfhosted.org> |
2021-04-07 17:41:48 | brandtbucher | link | issue43764 messages |
2021-04-07 17:41:48 | brandtbucher | create | |
|