โ† All lessons

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.

See the free lessons