New submission from Alex Jurkiewicz:

I'd like to add support for functools.lru_cache to have a callback parameter 
that runs every time an item is evicted from the cache. I've written a small 
prototype here:

https://github.com/alexjurkiewicz/cpython/commit/2f788387466720d47f2c82242ac33b107b0bf470

The prototype is incomplete:
* No C implementation
* Doesn't run on lru_cache.cache_clear()
* It would be nice to pass through args/kwargs for each evicted item

Comments welcome!

----------
components: Library (Lib)
messages: 276171
nosy: aj
priority: normal
severity: normal
status: open
title: Add callback to functools.lru_cache
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28112>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to