Skip to content

Instantly share code, notes, and snippets.

@jomido
Created May 25, 2017 14:22
Show Gist options
  • Save jomido/222d468f84ace8638a3da2130f1f4a36 to your computer and use it in GitHub Desktop.
Save jomido/222d468f84ace8638a3da2130f1f4a36 to your computer and use it in GitHub Desktop.
memoize decorator
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