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.| The Three of Wands
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.| The Three of Wands
If you've ever gone through the Mypy docs, you might have seen the section on TypedDict. The section goes on to introduce the feature by stating: Python programs often use dictionaries with string keys to represent objects. [...] you can use a TypedDict to give a precise type for objects like| The Three of Wands
This is the third post in my series on the inner workings of attrs. Here are the others: attrs I: The Basics attrs II: Slots What are Frozen Classes Frozen, in this context, is a synonym for immutable. The term frozen was chosen because there's precedent in the standard library| The Three of Wands
This is the second post in my series on the inner workings of attrs. The series starts here. Out of the box, attrs can customize your classes in two different, orthogonal ways - make your class a slot class (instead of a normal Python class, which for simplicity's sake we'll| The Three of Wands
This is the first article in my series on the inner workings of attrs. Attrs is a Python library for defining classes a different (much better) way. The docs can be found at attrs.readthedocs.org and are pretty good; they explain how and why you should use attrs. And| The Three of Wands