lisa.utils.lru_memoized#
- lisa.utils.lru_memoized(first_param_maxsize=None, other_params_maxsize=1024)[source]#
Decorator to memoize the result of a callable, based on
functools.lru_cache()
- Parameters:
Note
The first parameter of the callable is cached with a weak reference when the function is a method. 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.