7 Things You Didn’t Know Dataclasses Could Do

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. Dataclasses are often treated as nothing more than a shortcut for generating init methods, but there’s a lot more going on under the surface. In this video, I walk through several lesser-known dataclass features by gradually improving a simple example and showing how small changes can have a big impact on correctness, safety, and design. If you think you already know dataclasses, there’s a good chance you’ll learn something new here. 🔥 GitHub Repository: https://git.arjan.codes/2026/dataclass. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:54 1. A Safe Default Field 2:33 2. Derived Fields 4:54 3. Dataclasses Are Still Classes 6:27 4. Frozen Dataclasses 9:04 5. Slots, Ordering, and Keyword-only Arguments 11:20 6. Custom Constructors 13:55 7. Serialization Helpers 15:06 8. Abstract Dataclasses 19:53 Final Thoughts #arjancodes #softwaredesign #python