lru_cache: Construct a cache with least-recently-used policy.

Description Usage Arguments Value

Description

Construct a cache with least-recently-used policy.

Usage

1
lru_cache(size = 10000)

Arguments

size

The maximum number of results to keep.

Value

A function f(key, value) which takes a string in the first parameter and a lazily evaluated value in the second. 'f' will use the string key to retrieve a value from the cache, or return the matching item from the cache, or force the second argument and return that, remembering the result on future calls.

When the number of entries in the cache exceeds size, the least recently accessed entries are removed.


memo documentation built on May 2, 2019, 7:01 a.m.