mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-01 13:46:50 +08:00
add delete option to cache deleter
This commit is contained in:
@@ -9,7 +9,7 @@ time_caches = []
|
|||||||
star_import_cache = {}
|
star_import_cache = {}
|
||||||
|
|
||||||
|
|
||||||
def clear_caches():
|
def clear_caches(delete_all=False):
|
||||||
""" Jedi caches many things, that should be completed after each completion
|
""" Jedi caches many things, that should be completed after each completion
|
||||||
finishes.
|
finishes.
|
||||||
"""
|
"""
|
||||||
@@ -27,6 +27,11 @@ def clear_caches():
|
|||||||
# delete expired entries
|
# delete expired entries
|
||||||
del tc[key]
|
del tc[key]
|
||||||
|
|
||||||
|
if delete_all:
|
||||||
|
global time_caches
|
||||||
|
time_caches = []
|
||||||
|
star_import_cache.clear()
|
||||||
|
|
||||||
|
|
||||||
def memoize_default(default=None, cache=memoize_caches):
|
def memoize_default(default=None, cache=memoize_caches):
|
||||||
""" This is a typical memoization decorator, BUT there is one difference:
|
""" This is a typical memoization decorator, BUT there is one difference:
|
||||||
|
|||||||
Reference in New Issue
Block a user