If I define a function:
def f(x): return x+3
I can later store objects as attributes of the function, like so:
f.thing=\"he
If you are trying to do memoization, you can use a dictionary as a default parameter:
def f(x, memo={}): if x not in memo: memo[x] = x + 3 return memo[x]