-
Notifications
You must be signed in to change notification settings - Fork 323
Open
Description
Hi there,
Currently the decorator._produce_input_message
function uses "home-grown" introspection via f.__code__.(...)
to get the parameters of the method being wrapped.
This doesn't work if the method has some other decorator, because the introspection tries to find the arguments of the decorator, instead of the decorated method.
Here's a simple example:
from functools import wraps
def deco(f):
@wraps(f)
def wrapped(*args, *kwargs):
return f(*args, **kwargs)
return wrapped
class SomeService(ServiceBase):
@rpc(Unicode)
@deco
def someAction(ctx, some_argument):
pass
Using inspect.signature(f)
instead of reading f.__code__
might be a nice way to work around this problem.
Metadata
Metadata
Assignees
Labels
No labels