Python dataclasses

preview_player
Показать описание
Dataclasses are a new feature in Python 3.7 that are useful when defining classes that have a lot of state or data (well, as the name dataclasses implies). In this video, we show how to define dataclasses, how they help reduce boilerplate code, and how to customize the methods that dataclasses generates.

Further reading:
Рекомендации по теме
Комментарии
Автор

Nice video. I recently discovered about dataclases. But wasn't sure abput when to use it.
I think I have it more clear now

The Frozen parammeter seems very useful

johnbecker
Автор

@redshitzero Do you think that it can be used to represent structs or enums, or is any other beter way to do it?

johnbecker