lisa.utils.memoized#

lisa.utils.memoized(f)[source]#

Decorator to memoize the result of a callable, based on functools.lru_cache()

Note

The first parameter of the callable is cached with a weak reference. This suits well the method use-case, since we don’t want the memoization of methods to prevent garbage collection of the instances they are bound to.