[issue34235] PyArg_ParseTupleAndKeywords: support required keyword arguments

Michael Sullivan report at bugs.python.org
Fri Feb 1 22:54:24 EST 2019


Michael Sullivan <msully4321 at gmail.com> added the comment:

How about adding another sigil that indicates that subsequent keyword-only arguments are required? So then your example becomes (using ` as a totally strawman option):

    PyArg_ParseTupleAndKeywords(args, kwds, "O|O$O`O", kwlist, &a, &b, &d, &c)

It's a little complicated but so is Python argument processing, so maybe that makes sense.

I can submit a PR for this.

----------
nosy: +msullivan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34235>
_______________________________________


More information about the Python-bugs-list mailing list