python-makefun
python-makefun copied to clipboard
Provide a helper to create wrappers in case of varpositional wrapped
The following fails because the a argument ends up in kwargs
def f(a, *args):
pass
@wraps(f)
def foo(*args, **kwargs):
return f(*args, **kwargs) # TypeError: f() got multiple values for argument 'a'
foo('hello', 12)
We could wish to provide a parameter in wraps (or new_signature) so that one can receive the various pieces (maybe in a third argument ?) and do the call easily.