Message225531
Yes, I agree we should follow the Python level semantics, and only capture the excess positional arguments. For the record, the four builtins I flagged as needing this in order to add introspection information:
__build_class__
- 2 positional only args, arbitrary additional args
- checks size with PyTuple_GET_SIZE
- uses PyTuple_GET_ITEM x2 + PyTuple_GetSlice to unpack
print
- only arbitrary position args, iterates and extracts using PyTuple_GetItem
- uses PyArg_ParseTupleAndKeywords with an empty tuple to extract the keyword-only args
min
max
- use a shared helper function min_max
- uses the args tuple directly if size > 1
- otherwise uses PyArg_UnpackTuple to extract the supplied iterable
- uses PyArg_ParseTupleAndKeywords with an empty tuple to extract the keyword-only args
- this "one arg means iterable" style API might need to be a special case... |
|
Date |
User |
Action |
Args |
2014-08-19 12:40:52 | ncoghlan | set | recipients:
+ ncoghlan, larry, meador.inge, zach.ware |
2014-08-19 12:40:52 | ncoghlan | set | messageid: <1408452052.5.0.475754243183.issue20291@psf.upfronthosting.co.za> |
2014-08-19 12:40:52 | ncoghlan | link | issue20291 messages |
2014-08-19 12:40:52 | ncoghlan | create | |
|