Open juharris opened 6 years ago
Example:
@memoize(max_len=250, max_age_seconds=10) def fib(n): if n == 0: return 0 elif n == 1: return 1 return fib(n - 1) + fib(n - 2) assert 280571172992510140037611932413038677189525 == fib(200)
I'll add some docs and bump the version if the feature is wanted.
UPDATE: Not as important now that https://docs.python.org/3/library/functools.html#functools.lru_cache has been added. However, that method doesn't support eviction by age.
Any chance this can get merged?
Can one of the admins verify this patch?
Example:
I'll add some docs and bump the version if the feature is wanted.
UPDATE: Not as important now that https://docs.python.org/3/library/functools.html#functools.lru_cache has been added. However, that method doesn't support eviction by age.