Skip to content

Instantly share code, notes, and snippets.

@tkheyfets
Created February 14, 2018 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkheyfets/0c73209851b33f5a54eb50c155068a85 to your computer and use it in GitHub Desktop.
Save tkheyfets/0c73209851b33f5a54eb50c155068a85 to your computer and use it in GitHub Desktop.
def function_name (f):
dict = {}
def inner_function(x):
if x not in dict:
dict[x] = f(x)
return dict[x]
return inner_function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment