(fn, param, cache)
Calls fn(param), storing the result in cache, including CaseRowErrors
Calls fn(param), storing the result in cache, including CaseRowErrors
Calls fn ( param ) storing the result in cache including CaseRowErrors
def cached_function_call(fn, param, cache):
    """Calls fn(param), storing the result in cache, including CaseRowErrors"""
    if param in cache:
        result = cache[param]
        if isinstance(result, CaseRowError):
            raise result
        return result

    try:
        result = fn(param)
    except CaseRowError as err:
        cache[param] = err
        raise
    else:
        cache[param] = result
        return result
def cached_function_call ( fn , param , cache ) : if param in cache : result = cache [ param ] if isinstance ( result , CaseRowError ) : raise result return result try : result = fn ( param ) except CaseRowError as err : cache [ param ] = err raise else : cache [ param ] = result return result