Decorater inside a function? Is there a way?
Ron_Adam
radam2 at tampabay.rr.com
Sun Apr 3 09:23:28 EDT 2005
On 3 Apr 2005 00:20:32 -0800, "George Sakkis" <gsakkis at rutgers.edu>
wrote:
>Yes, it is possible to turn off type checking at runtime; just add this
>in the beginning of your define:
>
>def define(func):
> if not ENABLE_TYPECHECKING:
> return lambda func: func
> # else decorate func
>
>where ENABLE_TYPECHECKING is a module level variable that can be
>exposed to the module's clients. In my module, the default is
>ENABLE_TYPECHECKING = __debug__.
>
>
>George
Cool, I'll try that.
Thanks,
Ron
More information about the Python-list
mailing list