inkstitch/lib/utils/cache.py

16 wiersze
383 B
Python
Czysty Zwykły widok Historia

2021-03-12 04:17:19 +00:00
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
# simplify use of lru_cache decorator
2018-08-22 00:32:50 +00:00
def cache(*args, **kwargs):
return lru_cache(maxsize=None)(*args, **kwargs)