Can I undecorate a function?

2007-01-29 Thread 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)

Re: Can I undecorate a function?

2007-01-29 Thread skip
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

Re: Can I undecorate a function?

2007-01-29 Thread Diez B. Roggisch
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):

Re: Can I undecorate a function?

2007-01-29 Thread Kent Johnson
[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.

Re: Can I undecorate a function?

2007-01-29 Thread Steve Holden
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):