bag.memoize module

Decorator for caching computed values.

bag.memoize.memoize(limit=None, keymaker=None, cache_type=<class 'dict'>, debug=False)[source]

Memoize decorator with an LRU cache.

When full, the cache discards the least recently used value. You can pass cache_type=WeakValueDictionary (not tested).