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 <rep...@bugs.python.org>
<http://bugs.python.org/issue21684>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to