3 ms·
There is a LRU cache in the standard library starting in 3.2: https://docs.python.org/3/library/functools.html#functools.lru_cache https://docs.python.org/3/lib
by HZet0r 11y ago
There is a LRU cache in the standard library starting in 3.2: https://docs.python.org/3/library/functools.html#functools.lru_cache https://docs.python.org/3/library/functools.html#functools.l...
Doesn't have quite the same options, but arguably nicer to use because it's a decorator.
- mhashemi 11y agoboltons has an all-purpose cache decorator, which gives you an arrangement with a lot more in terms of flexibility and transparency: https://boltons.readthedocs.org/en/latest/cacheutils.html#automatic-function-caching https://boltons.readthedocs.org/en/latest/cacheutils.html#au...