← Winnitude! Search  ·  Reader Mode (462 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
REAL PYTHON · Real Python · 41 LINKS

Using Data Classes in Python - Real Python

Go to the next lesson

Using Data Classes in Python

Darren Jones 18 Lessons 1h 31m intermediate python

One new and exciting feature that came out in Python 3.7 was the data class. A data class is a class typically containing mainly data, although there aren't really any restrictions.

With data classes, you don't have to write boilerplate code to get proper initialization, representation, and comparisons for your objects.

In this course, you'll learn how to:

  • Define your own data classes
  • Add default values to the fields in your data class
  • Customize the ordering of data class objects
  • Work with immutable data classes

What's Included:

  • 18 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Accompanying Text-Based Tutorial
  • Interactive Quiz to Check Your Progress
  • 5 Hands-On Coding Exercises
  • Q&A With Python Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

Start Now

Using Data Classes in Python

18 Lessons 1h 31m

  1. 1. Using Data Classes in Python (Overview) 00:55
  2. 2. Comparison to Standard Classes 03:43
  3. 3. Alternatives to Standard Classes 06:25
  4. 4. Basic Data Classes 06:26
  5. 5. Exercise: Define a Product Data Class 08:00
  6. 6. More Flexible Data Classes 01:34
  7. 7. Advanced Default Values 06:02
  8. 8. Exercise: Build a Shopping Cart With Default Factory 08:30
  9. 9. Data Classes for Representation 03:17
  10. 10. Exercise: Format a Movie With a String Representation 08:00
  11. 11. Data Classes for Comparison 06:14
  12. 12. Exercise: Sort Prioritized Tasks 08:00
  13. 13. Immutable Data Classes 03:02
  14. 14. Exercise: Create an Immutable Color 08:00
  15. 15. Inheritance and Subclassing 03:18
  16. 16. Optimization of Data Classes 03:17
  17. 17. Using Data Classes in Python (Quiz) 06:00
  18. 18. Using Data Classes in Python (Summary) 00:47
Start Now

About Darren Jones

With 20 years as a teacher of music technology, Darren is keen to bring his skills to the Python table.

» More about Darren

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Christopher

Sadie

Tappan

Geir Arne

Dan

Joanna

Aldren

Martin

Related Courses:

Using Python Class Constructors

Test-Driven Development With pytest

← Browse All Courses