[New-bugs-announce] [issue28178] allow to cache_clear(some_key) in lru_cache

Sébastien de Menten report at bugs.python.org
Fri Sep 16 03:17:46 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue28178>
_______________________________________


More information about the New-bugs-announce mailing list