Created
July 10, 2014 18:44
-
-
Save justmytwospence/625f6b87534fa7eca563 to your computer and use it in GitHub Desktop.
Revisions
-
Spencer Boucher created this gist
Jul 10, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ def cache(func): saved = {} @wraps(func) def newfunc(*args): if args in saved: return newfunc(*args) result = func(*args) saved[args] = result return result return newfunc