Python 3.7's dataclasses reduce repetition in your class definitions.
Newcomers to Python often are surprised by how little code is required to accomplish quite a bit. Between powerful built-in data structures that can do much of what you need, comprehensions to take care of many tasks involving iterables, and the lack of getter and setter methods in class definitions, it's no wonder that Python programs tend to be shorter than those in static, compiled languages.
However, this amazement often ends when people start to define classes
in Python. True, the class definitions generally will be pretty
short. But the
__init__ method, which adds attributes to a new object,
tends to be rather verbose and repetitive—for example: