[Soap-Python] Multiple decorators

Dieter Maurer dieter at handshake.de
Fri Sep 30 10:33:32 CEST 2011


Burak Arslan wrote at 2011-9-29 17:37 +0300:
>On 29.09.2011 16:34, azurIt wrote:
>> is it somehow possible to use multiple decorators with @rpc/srpc ?
>>
>>
>
>Here's the magic from the rpclib.decorator module:
>
>     argcount = f.func_code.co_argcount
>     param_names = f.func_code.co_varnames[arg_start:argcount]
>
>if f is your decorator, the parameter names and numbers are going to be
>wrong. so no, use events. look at the relevant example in the source
>distribution and read the events section in the manual.

To define one own decorators, there is the great "decorator" package
(on PyPI). It makes it easy to implement signature preserving
decorators -- often important for things such as pipelining
several decorators.



--
Dieter


More information about the Soap mailing list