With PEP 557 data classes are introduced into python standard library.
They make use of the @dataclass decorator and they are supposed to be "mutable namedtuples with default" but I'm not really sure I understand what this actually means and how they are different from common classes.
What exactly are python data classes and when is it best to use them?
From the PEP specification:
A class decorator is provided which inspects a class definition for variables with type annotations as defined in PEP 526, "Syntax for Variable Annotations". In this document, such variables are called fields. Using these fields, the decorator adds generated method definitions to the class to support instance initialization, a repr, comparison methods, and optionally other methods as described in the Specification section. Such a class is called a Data Class, but there's really nothing special about the class: the decorator adds generated methods to the class and returns the same class it was given.
The @dataclass generator adds methods to the class that you'd otherwise define yourself like __repr__, __init__, __lt__, and __gt__.