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)
Matt In some instances I want to access just the function f, though,
Matt and catch the values before they've been decorated.
def f(x):
return x * x
@as_string
def fs(x):
return f(x)
Call the one you want.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Matthew Wilson wrote:
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):
[EMAIL PROTECTED] wrote:
Matt In some instances I want to access just the function f, though,
Matt and catch the values before they've been decorated.
def f(x):
return x * x
@as_string
def fs(x):
return f(x)
or just
fs = as_string(f)
Kent
Call the one you want.
Matthew Wilson wrote:
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):