Lesson 36 of 62 ยท about 16 minutes
Dataclasses ๐งฑ
Dataclasses ๐งฑ Many classes mostly exist to hold data. Writing __init__ , __repr__ and __eq__ by hand for every one of them is repetitive and easy to get wrong. The @dataclass decorator writes them for you from a simple list of fields. Your first dataclassโฆ
This lesson is part of Pythonaut Pro. The first two lessons are free, so you can start there and see how it works.