This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aj
Recipients aj
Date 2016-09-13.04:53:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473742415.72.0.834359369661.issue28112@psf.upfronthosting.co.za>
In-reply-to
Content
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!
History
Date User Action Args
2016-09-13 04:53:35ajsetrecipients: + aj
2016-09-13 04:53:35ajsetmessageid: <1473742415.72.0.834359369661.issue28112@psf.upfronthosting.co.za>
2016-09-13 04:53:35ajlinkissue28112 messages
2016-09-13 04:53:35ajcreate