since we do not know in advance what the function will be in the functon wrappers, the __call__ method is usually defined with the (*args, **kwargs) signature. however at runtime, when the wrapper is instanciated we know what the wrapped function is and we can return an argcount in most cases.
This PR adds the _argcount value to the function wrapper when possible, simply returning the argcount of the wrapped function when appropriate or with a few adjustments when needed. This way they can be used nicely with other functions that takes predicate like in the example in the issue linked above.
coverage: 100.0%. remained the same
when pulling f7e402bceef64d2a8a62ac90e1e3856d915482e3 on DeviousStoat:add-argcount-to-function-wrappers
into 2a2fb8e58873de6f75a08927aaad653ebfa1fb97 on dgilland:develop.
fixes #210
since we do not know in advance what the function will be in the functon wrappers, the
__call__
method is usually defined with the(*args, **kwargs)
signature. however at runtime, when the wrapper is instanciated we know what the wrapped function is and we can return an argcount in most cases.This PR adds the
_argcount
value to the function wrapper when possible, simply returning the argcount of the wrapped function when appropriate or with a few adjustments when needed. This way they can be used nicely with other functions that takes predicate like in the example in the issue linked above.