Created
May 25, 2017 14:22
-
-
Save jomido/222d468f84ace8638a3da2130f1f4a36 to your computer and use it in GitHub Desktop.
memoize decorator
This file contains 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 characters
from functools32 import lru_cache | |
from functools import partial | |
memoize = partial(lru_cache, maxsize=128) | |
@memoize() | |
def function_to_memoize(arg1, arg2, kwarg1=None): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment