Eric V. Smith <e...@trueblade.com> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44768> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com