euporie.core.border.FastDictCache

class euporie.core.border.FastDictCache(get_value: Callable[[...], _V], size: int = 1000000)

Fast, lightweight cache which keeps at most size items. It will discard the oldest items in the cache first.

The cache is a dictionary, which doesn’t keep track of access counts. It is perfect to cache little immutable objects which are not expensive to create, but where a dictionary lookup is still much faster than an object instantiation.

Parameters:

get_value – Callable that’s called in case of a missing key.