lck.common 0.4.5 documentation
lck.cache.memoization
¶Implements a reusable memoization decorator. It is using a finite-size cache with pickled arguments as keys, to hold the outcome of a specific function call. When the decorated function is called again with the same arguments, the outcome is fetched from the cache instead of being recalculated again.
The cache used maintains a list of Least Recently Used keys so that in case of overflow only the seemingly least important ones get deleted.
Note
Instead of importing the whole structure, a recommended shortcut is available.
Use from lck.cache import memoize
.
memoize
(func=None, update_interval=300, max_size=256, skip_first=False, fast_updates=True)¶Memoization decorator.
Parameters: |
|
---|