Replace rez.utils.data_utils.cached_property
with functools.cached_property
#1637
Labels
rez.utils.data_utils.cached_property
with functools.cached_property
#1637
Now that we dropped support for Python 2, we should take a look at if we can replace
rez.utils.data_utils.cached_property
withfunctools.cached_property
.rez.utils.data_utils.cached_property
has multiple issues, one of which is that sphinx doesn't recognize the wrapped function as a property, see https://rez.readthedocs.io/en/stable/api/rez.system.html#rez.system.System.platform. On top of that, I don't think it's type hint friendly.Python now has a built-in
cached_property
in thefunctools
module.Things to take into consideration:
uncache
method. Is it something we need?functools.cached_property
be slower or faster than what we have today? Slower would mean that we would need to find a way to make Sphinx recognize cached properties correctly.This is at the very core of rez, so we have to be careful.
The text was updated successfully, but these errors were encountered: