equal
deleted
inserted
replaced
33 # get and put in terms of key, depends on further usage |
33 # get and put in terms of key, depends on further usage |
34 |
34 |
35 def cache(func): |
35 def cache(func): |
36 """Decorator that caches the result from func. |
36 """Decorator that caches the result from func. |
37 """ |
37 """ |
38 |
38 |
39 @wraps(func) |
39 @wraps(func) |
40 def wrapper(*args, **kwargs): |
40 def wrapper(*args, **kwargs): |
41 result, key = get(*args, **kwargs) |
41 result, key = get(*args, **kwargs) |
42 if result: |
42 if result: |
43 return result |
43 return result |