Skip to content

Instantly share code, notes, and snippets.

@Katharine
Created April 4, 2012 20:00
Show Gist options
  • Save Katharine/2305157 to your computer and use it in GitHub Desktop.
Save Katharine/2305157 to your computer and use it in GitHub Desktop.
def cached_execution(cache, f, *args):
key = (f, args)
if key not in cache:
cache[key] = f(*args)
return cache[key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment