Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ memf
Function
memf
recipes/Python/577219_Minimalistic_Memoization/recipe-577219.py:9–12 ·
view source on GitHub ↗
(*x)
Source
from the content-addressed store, hash-verified
7
def
memoize(f):
8
cache= {}
9
def
memf(*x):
10
if
x not in cache:
11
cache[x] = f(*x)
12
return
cache[x]
13
return
memf
14
15
fib = memoize(fib)
Callers
nothing calls this directly
Calls
1
f
Function · 0.50
Tested by
no test coverage detected