# yt.utilities.lru_cache module¶

lru_cache compatible with py2.6->py3.2 copied directly from http://code.activestate.com/ recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/

adapted from sympy by Nathan Goldbaum

yt.utilities.lru_cache.local_lru_cache(maxsize=100, typed=False, make_key=<function _make_key>)

Least-recently-used cache decorator. If maxsize is set to None, the LRU features are disabled and the cache can grow without bound. If typed is True, arguments of different types will be cached separately. For example, f(3.0) and f(3) will be treated as distinct calls with distinct results. Arguments to the cached function must be hashable. View the cache statistics named tuple (hits, misses, maxsize, currsize) with f.cache_info(). Clear the cache and statistics with f.cache_clear(). Access the underlying function with f.__wrapped__. See: http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used