isolate_lru_cache
Clear the cache of an LRU cache object on entering and exiting.
def isolate_lru_cache(
lru_cache_object: functools._lru_cache_wrapper
) - > contextmanager
Clear the cache of an LRU cache object on entering and exiting.
Parameters
| Name | Type | Description |
|---|---|---|
| lru_cache_object | functools._lru_cache_wrapper | The LRU cache-decorated function whose cache should be cleared before and after the context block. |
Returns
| Type | Description |
|---|---|
contextmanager | A context manager that ensures the cache is empty during the execution of the wrapped block. |