[New-bugs-announce] [issue21684] inspect.signature bind doesn't include defaults or empty tuple/dicts

Ryan McCampbell report at bugs.python.org
Sat Jun 7 07:10:48 CEST 2014


New submission from Ryan McCampbell:

I'm not sure if this is really a bug, but it is unexpected behavior. When you call "bind" on a Python 3.3 signature object, if you omit an optional argument, the default is not provided in the arguments dict. Similarly, if there is a "var positional" or "var keyword" parameter but there are no extra arguments, it will not be included. To emulate the effect on the namespace of an actual function, I would expect these to be included, as an empty tuple/dict in the case of variable arguments. I realize the current behavior may be useful in some cases, but if so, then another method could be added: bind_full, which would include all parameters of the signature.

----------
messages: 219916
nosy: rmccampbell7
priority: normal
severity: normal
status: open
title: inspect.signature bind doesn't include defaults or empty tuple/dicts
type: behavior
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21684>
_______________________________________


More information about the New-bugs-announce mailing list