This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients pitrou, yselivanov
Date 2015-05-14.10:19:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The recipe to inject default values in a BoundArguments instance is given in the doc, but it's not trivial. Furthermore, it's actually incomplete: it doesn't handle any star-arguments, e.g.:

>>> sig = inspect.signature(f)
>>> ba = sig.bind(2, d=4)
>>> for param in sig.parameters.values():
...     if ( not in ba.arguments
...             and param.default is not param.empty):
...         ba.arguments[] = param.default
>>> ba.arguments
OrderedDict([('a', 2), ('d', 4), ('b', 5)])

ba['c'] would ideally contain the empty tuple.
Date User Action Args
2015-05-14 10:20:00pitrousetrecipients: + pitrou, yselivanov
2015-05-14 10:20:00pitrousetmessageid: <>
2015-05-14 10:20:00pitroulinkissue24190 messages
2015-05-14 10:19:59pitroucreate