lazy
lazy copied to clipboard
duplication of functools.lru_cache?
this looks like what the builtin functools.lru_cache does
Lazy is not a cache, it is about lazily creating attributes. I regret giving the caching example. ;-)
What lazy does is replace the descriptor with the returned value in the class dict. I have seen this mechanism being called "reification" in other places.
python3.8 added https://docs.python.org/3/library/functools.html#functools.cached_property which does the same. Thanks for creating this package years ago!
Yep, cached_property is very similar. It has an additional lock though (at least until Python 2.13 when the lock will go away).