Given the following code,
def myfunc(a=None, b=None, c=None, **kw):
func(arga=a, argb=b, **kw)
#do something with c
def func(arga=None, argb=None, argc=None):
....
Can I replicate part of the signature of func, namely the missing args, without imitating every missing arg of func manually?
Put it more simply, I want to see argc in keywords of myfunc such that myfunc? would be different. It would contain argc. myfunc(a=None,b=None,c=None,argc=None)
@functools.wraps allows for wrapping a complete functions. Using partial can subtract args. But don't know to add.
functools.wrapsandfunctools.partialare doing pretty unrelated things But maybe I'm missing something obviouswraps(partial(func,1,1))I can subtract args from func. not obvious.locals().copy()as an argument?would be different. It would contain argc.func(a=None,b=None,c=None,argc=None). My original problem is a wrapper of mongo queries and allowed the keywords ofpymongo.findin my original function. The thing is that nnobody (some people) don't know the full options of find..