How do I match my functions variable names to the default values using python and inspect?
def foo(x:int,y:int=5) -> int: return a+b
inspect.getfullargspec(foo)
FullArgSpec(args=['x', 'y'], varargs=None, varkw=None, defaults=(4,), kwonlyargs=[], kwonlydefaults=None, annotations={'x': <class 'int'>, 'y': <class 'int'>, 'return': <class 'int'>})
I can get the args and get the defaults, but the aren't 1:1 when you try to line them up.
If you were to zip the two arrays into a dictionary, the x would get mapped to 4 and y isn't mapped to anything. But the result should be y=4.
Thanks