Message398429
I agree with Steven, but since I have this typed up I'll post it here.
Yes, iterability is another namedtuple feature. Although that would actually be easy to add to dataclasses, so I didn't mention it.
I don't really see the point of combining them, except for some conceptual purity argument.
You can already write a wrapper decorator which, given the various parameters to @dataclass, decides if it will produce a dataclass or a namedtuple. For example, there couldn't be any fields with init=False, or kwonly=True, the class would have to have frozen=True, etc. |
|
Date |
User |
Action |
Args |
2021-07-28 21:37:09 | eric.smith | set | recipients:
+ eric.smith, rhettinger, steven.daprano, pavel-lexyr |
2021-07-28 21:37:09 | eric.smith | set | messageid: <1627508229.69.0.514866376157.issue44768@roundup.psfhosted.org> |
2021-07-28 21:37:09 | eric.smith | link | issue44768 messages |
2021-07-28 21:37:09 | eric.smith | create | |
|