Nick Coghlan added the comment: 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... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20291> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com