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 Sébastien de Menten
Recipients Sébastien de Menten
Date 2016-09-16.07:17:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474010266.85.0.645671097891.issue28178@psf.upfronthosting.co.za>
In-reply-to
Content
It would be useful to be able to clear a single item in the cache of a lru_cache decorated function.

Currently with:

@lru_cache
def foo(i):
  return i*2
foo(1)    # -> add 1 as key in the cache
foo(2)    # -> add 2 as key in the cache
foo.clear_cache() # -> this clears the whole cache
foo.clear_cache(1) # -> this would clear the cache entry for 1
History
Date User Action Args
2016-09-16 07:17:46Sébastien de Mentensetrecipients: + Sébastien de Menten
2016-09-16 07:17:46Sébastien de Mentensetmessageid: <1474010266.85.0.645671097891.issue28178@psf.upfronthosting.co.za>
2016-09-16 07:17:46Sébastien de Mentenlinkissue28178 messages
2016-09-16 07:17:46Sébastien de Mentencreate