Description
The query_param
decorator is used on pretty much all client methods. It uses functools.wraps
to copy __module__
, __name__
, __doc__
etc. Unfortunately, wraps
does not preserve the signature of the wrapped function, so inspect.getargspec()
and friends become pretty much useless (inspect.signature()
works but only in Python 3.5+, and only because it cheats).
This makes it difficult for e.g. code completion in IDEs to work correctly. On a more egoistic note, it also makes it more difficult for things like Elastic APM to introspect the client 😊
Preserving the signature is a bit less trivial than preserving __doc__
etc, but there are a few utilities that could help:
decorator.py
- boltons (specifically
boltons.funcutils.wraps
)
There's also wrapt, but that might be a bit too heavy just to preserve the signature.
We could either add one of the two libraries as a dependency, or vendor them (they are both BSD).