← 输入框|bugs.python.org|刷新

➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 ncoghlan
收信人 larry, meador.inge, ncoghlan, zach.ware
日期 2014-08-19.12:40:52
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1408452052.5.0.475754243183.issue20291@psf.upfronthosting.co.za>
In-reply-to
内容
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...
历史
日期 用户 动作 参数
2014-08-19 12:40:52ncoghlan修改recipients: + ncoghlan, larry, meador.inge, zach.ware
2014-08-19 12:40:52ncoghlan修改messageid: <1408452052.5.0.475754243183.issue20291@psf.upfronthosting.co.za>
2014-08-19 12:40:52ncoghlan链接issue20291 messages
2014-08-19 12:40:52ncoghlan创建