Can I undecorate a function?

Kent Johnson kent at kentsjohnson.com
Mon Jan 29 19:13:57 CET 2007


skip at pobox.com 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.
> 
> Skip



More information about the Python-list mailing list