Finding a path forward for `functools.cached_property`

That’s arguable. Yes, you can use it with slots but it requires you to put __dict__ in the __slots__ which defeats the memory savings that to my knowledge are main use case for slotted classes. Meanwhile, werkzeug implementation solves it by allowing you to define a slot for the cached value, which means you don’t have to have an instance dict.

2 Likes