189: attrs and dataclasses - Hynek Schlawack
In Python, before dataclasses, we had attrs.
Before attrs, it wasn't pretty.
Before attrs, it wasn't pretty.
The story of attrs and dataclasses is actually intertwined.
They've built on each other.
And in the middle of it all, Hynek.
They've built on each other.
And in the middle of it all, Hynek.
Hynek joins the show today to discuss some history of attrs and dataclasses, and some differences.
If you ever need to create a custom class in Python, you should listen to this episode.
Links:
- attrs documentation
- History of attrs and introduction to attrs namespace
- cattrs: Complex custom class converters for attrs. — python-attrs
- PEP 557 – Data Classes
- PEP 681 – Data Class Transforms
Sponsored by:
- The Complete pytest course is now a bundle, with each part available separately.
- pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively.
- Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI
- Then pytest Booster Rockets can help with advanced parametrization and building plugins.
- Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.
Creators and Guests

Guest
Hynek Schlawack
Hynek is a Python & Go developer, DevOps engineer, blogger, public speaker, PSF fellow, and creator of attrs. He's also the maintainer of structlog and contributor to CPython and Twisted.
