[issue22998] inspect.Signature and default arguments
9 Dec
2014
9 Dec
'14
4:33 p.m.
Walter Dörwald added the comment:
The updated code in the documentation still doesn't set the * and ** parameters. I would have preferred the following code:
for param in sig.parameters.values():
if param.name not in ba.arguments:
if param.kind is inspect.Parameter.VAR_POSITIONAL:
default = ()
elif param.kind is inspect.Parameter.VAR_KEYWORD:
default = {}
else:
default = param.default
ba.arguments[param.name] = default
----------
_______________________________________
Python tracker
3418
Age (days ago)
3418
Last active (days ago)
0 comments
1 participants
participants (1)
-
Walter Dörwald