While this is not much more code to write, you can already see signs of the boilerplate pain: rank and suit are both repeated three times simply to initialize an object. While this might seem like a good thing, this lack of awareness about its own type can lead to subtle and hard-to-find bugs, especially since it will also happily compare two different namedtuple classes: The attrs project is great and does support some features that data classes do not, including converters and validators. In addition to tuple , dict , namedtuple , and attrs , there are many other similar projects , including typing.NamedTuple , namedlist , attrdict , plumber , and fields . In fact, adding some kind of type hint is mandatory when defining the fields in your data class.

"One new and exciting feature coming in Python 3.7 is the data class. A data class is a class typically containing mainly data, although there aren’t really any restrictions. [...] A data class comes with basic functionality already implemented. For instance, you can instantiate, print, and compare data class instances straight out of the box"