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

2014-06-25 Thread Yury Selivanov
Yury Selivanov added the comment: > But I can't think of any use case when it would be undesirable to include the > extra parameters One use case is that you are actually loosing information what arguments Signature.bind() was called with, when defaults are included. In some cases this inform

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

2014-06-24 Thread Ryan McCampbell
Ryan McCampbell added the comment: It's not really a particular use case. I was making a function decorator for automatic type checking using annotations (ironically I discovered later there is an almost identical example in the PEP for signatures). But I can't think of any use case when it wo

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

2014-06-23 Thread Yury Selivanov
Yury Selivanov added the comment: Ryan, Can you explain the use case for it? What's the problem you're trying to solve? -- ___ Python tracker ___

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

2014-06-21 Thread Ryan McCampbell
Ryan McCampbell added the comment: Copying defaults still doesn't give you var positional/keyword arguments, which means, you have to explicitly check the parameter type, and then add them in. I still think it would more useful to have an "official" way of getting all function parameters from

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

2014-06-20 Thread Yury Selivanov
Yury Selivanov added the comment: That's the intended and documented behaviour, see https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments. You can easily implement the functionality you need by iterating through Signature.parameters and copying defaults to the BoundAr

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

2014-06-14 Thread Ryan McCampbell
Ryan McCampbell added the comment: If this is decided against, a partial solution would be to set the "default" attribute of VAR_POSITIONAL and VAR_KEYWORD args to an empty tuple/dict, respectively. Then you could get a parameter's value no matter what with boundargs.get(param.name, param.defa

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

2014-06-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> test needed versions: +Python 3.5 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list ma

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

2014-06-07 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

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

2014-06-07 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

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

2014-06-06 Thread Ryan McCampbell
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 "va