diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/arg.rst | 11 | ||||
-rw-r--r-- | Doc/glossary.rst | 2 | ||||
-rw-r--r-- | Doc/whatsnew/3.6.rst | 5 |
3 files changed, 16 insertions, 2 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index d9f0f43..d15f649 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -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) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index e7bcb6a..b4f3089 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -718,6 +718,8 @@ Glossary def func(foo, bar=None): ... + .. _positional-only_parameter: + * :dfn:`positional-only`: specifies an argument that can be supplied only by position. Python has no syntax for defining positional-only parameters. However, some built-in functions have positional-only diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index f438f0b..5dc6076 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -503,6 +503,11 @@ Build and C API Changes * New :c:func:`Py_FinalizeEx` API which indicates if flushing buffered data failed (:issue:`5319`). +* :c:func:`PyArg_ParseTupleAndKeywords` now supports :ref:`positional-only + parameters <positional-only_parameter>`. Positional-only parameters are + defined by empty names. + (Contributed by Serhit Storchaka in :issue:`26282`). + Deprecated ========== |