These lessons are part of a Real Python video course by Darren Jones.
Using Data Classes in Python (Overview)
00:04 Data classes were introduced with Python 3.7 and they’re a class which typically contain mainly data, although there aren’t really any restrictions. They provide a convenient way to define classes which exist primarily to store data and allow value retrieval via attribute lookup.
00:23 In this video course, you’ll learn exactly which conveniences data classes provide. In addition to nice representations and comparisons, you’ll see how to add default values to data class fields, how data classes allow for ordering of objects, how to represent immutable data, and how data classes handle inheritance. So, with no further ado, let’s take a look at a comparison between using a data class and a standard class for storing data.
You must own this product to join the conversation.