If I have these two functions:
def foo(code:int, *args, **kwargs):
if code == 1:
bar(*args, **kwargs)
else:
return None
def bar(a:str, b:int, c:int=1, d:int=2):
pass
I want users can see what argument can be passed to foo
, just like if I define foo
like:
def foo(code:int, a:str, b:int, c:int=1, d:int=2):
if code == 1:
bar(a, b, c, d)
else:
return None
What can I do to inherit bar
's argument in foo
?
ParamSpec
is almost there but not enough for my situation, foo
has one more argumnt: code
than bar
.