(func)
return caching_wrapper
Caching decorator with an unbounded cache size.
Caching decorator with an unbounded cache size.
Caching decorator with an unbounded cache size .
def unbound_cache(func):
    """Caching decorator with an unbounded cache size.
    """

    cache = {}

    @functools.wraps(func)
    def caching_wrapper(*args):
        try:
            return cache[args]
        except KeyError:
            result = func(*args)
            cache[args] = result
            return result

    return caching_wrapper
def unbound_cache ( func ) : cache = { } @ functools . wraps ( func ) def caching_wrapper ( * args ) : try : return cache [ args ] except KeyError : result = func ( * args ) cache [ args ] = result return result return caching_wrapper