Issue 28112: Add callback to functools.lru_cache (original) (raw)

Alex, I would like to pass on this feature request and keep the lru_cache API focused on its core task. As it stands now, it was already difficult to fight reentrancy problems.

FWIW, it is very easy to roll your own LRU variants using collections.OrderedDict. Also, if you're inclined, you can post Python recipes and at the ASPN Python website -- that is where I post my LRU variants.