New submission from Sébastien de Menten:

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

----------
components: Library (Lib)
messages: 276680
nosy: Sébastien de Menten
priority: normal
severity: normal
status: open
title: allow to cache_clear(some_key) in lru_cache
type: enhancement

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

Reply via email to