lru_ng: Mapping with LRU replacement and callback

lru_ng is a Python module based on the original lru module by Amit Dev. It features better support for a threaded environment, greater control over callback execution, and other internal bug-fixes and improvements.

In most situations, drop-in compatibility with lru.LRU can be achieved by the following import statement in Python code:

from lru_ng import LRUDict as LRU

Differences from lru.LRU are described in the Compatibility section.

The code is optimized for fast insertion, deletion, and eviction. The extension class participates in Python’s cycle garbage collection.

Indices and tables