attrs supports frozen classes. Frozen classes are cool for a multitude of reasons, but they're a tiny bit slower to instantiate compared to non-frozen classes.
But there's a way to avoid this overhead and make frozen classes be the exact same speed as ordinary classes.
This post is an account of why I prefer using the attrs library over Pydantic. I'm writing it since I am often asked this question and I want to have something concrete to link to.
If you've ever gone through the Mypy docs, you might have seen the section on
TypedDict [https://mypy.readthedocs.io/en/stable/more_types.html#typeddict]. The
section goes on to
This is the third post in my series on the inner workings of attrs. Here are the
others:
* attrs I: The Basics [https://threeofwands.com/attrs-i-the-basics/]
* attrs II: Slots [https://threeofwands.com/attrs-ii-slots/
This is the second post in my series on the inner workings of attrs. The series
starts here [https://threeofwands.com/attrs-i-the-basics/].
Out of the box, attrs can customize your classes in two