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:

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 <>
Python-bugs-list mailing list

Reply via email to