M
Matthew Wilson
The decorator as_string returns the decorated function's value as
string. In some instances I want to access just the function f,
though, and catch the values before they've been decorated.
Is this possible?
def as_string(f):
def anon(*args, **kwargs):
y = f(*args, **kwargs)
return str(y)
return anon
@as_string
def f(x):
return x * x
Matt
string. In some instances I want to access just the function f,
though, and catch the values before they've been decorated.
Is this possible?
def as_string(f):
def anon(*args, **kwargs):
y = f(*args, **kwargs)
return str(y)
return anon
@as_string
def f(x):
return x * x
Matt