@lru_cache on functions with no arguments

Thomas Nyberg tomuxiong at gmx.com
Tue Aug 1 07:53:56 EDT 2017


On 08/01/2017 01:06 PM, Matt Wheeler wrote:
> A function which is moderately expensive to run, that will always return
> the same result if run again in the same process, and which will not be
> needed in every session.
> 

What about just using a lazy getter property? E.g.:

	https://pypi.python.org/pypi/lazy-property

Cheers,
Thomas



More information about the Python-list mailing list