Data Classes vs typing.NamedTuple primary use cases
问题 Long story short PEP-557 introduced data classes into Python standard library, that basically can fill the same role as collections.namedtuple and typing.NamedTuple . And now I'm wondering how to separate the use cases in which namedtuple is still a better solution. Data classes advantages over NamedTuple Of course, all the credit goes to dataclass if we need: mutable objects inheritance support property decorators, manageable attributes generated method definitions out of the box or