__slots__ is a good way to make Python classes more efficient. There is a catch though: you need to use it consistently in all base classes, or you don't get the full benefits.
This is easy to forget, and there's nothing warning you if you mess up!
After fixing this in the `returns` library, I decided to create a tool `slotscheck` to detect this common problem anywhere.
After fixing this in the `returns` library, I decided to create a tool `slotscheck` to detect this common problem anywhere.
I ended up finding broken slots in popular libraries, and even the stdlib. (see my blog post for the findings: https://dev.arie.bovenberg.net/blog/finding-broken-slots-in-...)