May 2019
Beginner
528 pages
29h 51m
English
Though named tuples allow you to reference their members by name, they’re still just tuples, not classes. For some of the benefits of named tuples, plus the capabilities that traditional Python classes provide, you can use Python 3.7’s new data classes12 from the Python Standard Library’s dataclasses module.
Data classes are among Python 3.7’s most important new features. They help you build classes faster by using more concise notation and by autogenerating “boilerplate” code that’s common in most classes. They could become the preferred way to define many Python classes. In this section, we’ll present data-class fundamentals. At the end of the ...
Read now
Unlock full access