MENU

Fun & Interesting

Attrs, Pydantic, or Python Data Classes?

ArjanCodes 94,268 2 years ago
Video Not Working? Fix It Now

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. Data classes are a valuable tool in the Python programmer's toolkit. Despite their usefulness (I do like them a lot!), they do have limitations. In this video, I compare dataclasses with two alternative options, attrs and Pydantic, to help you decide which one to use in your code. GitHub repository here: https://github.com/ArjanCodes/2023-attrs 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/ 🔖 Chapters: 0:00 Intro 1:34 Example explanation 4:20 Comparison 7:07 Attribute validation 11:26 Pros and cons dataclasses 13:00 Pros and cons attrs 14:14 Pros and cons Pydantic 15:58 Final thoughts 16:42 Outro #arjancodes #softwaredesign #python

Comment