Finding a path forward for `functools.cached_property`

I would consider this rather a variant of option 1, since it shares the key feature that functools.cached_property becomes lock-free by default without a deprecation process.

If we want to do option 1, but also keep a locking version available in the stdlib, I think it’s slightly nicer to keep it under a new name (locking_cached_property) rather than using a kwarg.

Given that evidence suggests most users don’t need locking, and it has overhead, even presuming someone implements per-instance locking I don’t see why we would ever go through the disruption of a deprecation process to change the default to one that is probably less desirable for most users.

1 Like