diff options
Diffstat (limited to 'lib/utils/cache.py')
| -rw-r--r-- | lib/utils/cache.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils/cache.py b/lib/utils/cache.py new file mode 100644 index 00000000..38fe8f2c --- /dev/null +++ b/lib/utils/cache.py @@ -0,0 +1,8 @@ +try: + from functools import lru_cache +except ImportError: + from backports.functools_lru_cache import lru_cache + +# simplify use of lru_cache decorator +def cache(*args, **kwargs): + return lru_cache(maxsize=None)(*args, **kwargs) |
