Issue #26282: PyArg_ParseTupleAndKeywords() and Argument Clinic now support

positional-only and keyword parameters in the same function.
This commit is contained in:
Serhiy Storchaka 2016-06-09 16:30:29 +03:00
parent 339880809a
commit f41b82fb19
9 changed files with 210 additions and 72 deletions

View file

@ -406,8 +406,15 @@ API Functions
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
Parse the parameters of a function that takes both positional and keyword
parameters into local variables. Returns true on success; on failure, it
returns false and raises the appropriate exception.
parameters into local variables. The *keywords* argument is a
*NULL*-terminated array of keyword parameter names. Empty names denote
:ref:`positional-only parameters <positional-only_parameter>`.
Returns true on success; on failure, it returns false and raises the
appropriate exception.
.. versionchanged:: 3.6
Added support for :ref:`positional-only parameters
<positional-only_parameter>`.
.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)