From 2bbe45247917b0cff9c323dffba86e6df32fe1dc Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 24 Feb 2024 15:03:54 +0100 Subject: [PATCH] clarify that the wrapper function as private --- cachier/core.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cachier/core.py b/cachier/core.py index 6bd0d871..987e35c5 100644 --- a/cachier/core.py +++ b/cachier/core.py @@ -268,19 +268,19 @@ def func_wrapper(*args, **kwds): _print("No entry found. No current calc. Calling like a boss.") return _calc_entry(core, key, func, args, kwds) - def clear_cache(): + def _clear_cache(): """Clear the cache.""" core.clear_cache() - def clear_being_calculated(): + def _clear_being_calculated(): """Marks all entries in this cache as not being calculated.""" core.clear_being_calculated() - def cache_dpath(): + def _cache_dpath(): """Returns the path to the cache dir, if exists; None if not.""" return getattr(core, "cache_dir", None) - def precache_value(*args, value_to_cache, **kwds): + def _precache_value(*args, value_to_cache, **kwds): """Add an initial value to the cache. Arguments @@ -295,10 +295,10 @@ def precache_value(*args, value_to_cache, **kwds): ) return core.precache_value(tuple(), kwargs, value_to_cache) - func_wrapper.clear_cache = clear_cache - func_wrapper.clear_being_calculated = clear_being_calculated - func_wrapper.cache_dpath = cache_dpath - func_wrapper.precache_value = precache_value + func_wrapper.clear_cache = _clear_cache + func_wrapper.clear_being_calculated = _clear_being_calculated + func_wrapper.cache_dpath = _cache_dpath + func_wrapper.precache_value = _precache_value return func_wrapper return _cachier_decorator