Рет қаралды 82,650
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: github.com/Arj...
✍🏻 Take a quiz on this topic: www.learntail....
🚀 Next-Level Python Skillshare Class: skl.sh/3ZQkUEN
💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com....
💻 ArjanCodes Blog: www.arjancodes...
🎓 Courses:
The Software Designer Mindset: www.arjancodes...
The Software Designer Mindset Team Packages: www.arjancodes...
The Software Architect Mindset: Pre-register now! www.arjancodes...
Next Level Python: Become a Python Expert: www.arjancodes...
The 30-Day Design Challenge: www.arjancodes...
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
💬 Discord: discord.arjan....
🐦Twitter: / arjancodes
🌍LinkedIn: / arjancodes
🕵Facebook: / arjancodes
📱Instagram: / arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- James Dooley
- Dale Hagglund
🎥 Video edited by Mark Bacskai: / bacskaimark
💻 Code example by Henrique Branco: / henriqueajnb
🔖 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
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!