apply_defaults()
Set default values for missing arguments.
For variable-positional arguments (*args
) the default is an empty tuple.
For variable-keyword arguments (**kwargs
) the default is an empty dict.
>>> def foo(a, b='ham', *args): pass >>> ba = inspect.signature(foo).bind('spam') >>> ba.apply_defaults() >>> ba.arguments OrderedDict([('a', 'spam'), ('b', 'ham'), ('args', ())])
New in version 3.5.
Please login to continue.