mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #14328: Add keyword-only parameters to PyArg_ParseTupleAndKeywords.
They're optional-only for now (unlike in pure Python) but that's all I needed. The syntax can easily be relaxed if we want to support required keyword-only arguments for extension types in the future.
This commit is contained in:
parent
2a886412ba
commit
83a9f48699
4 changed files with 134 additions and 3 deletions
|
@ -338,6 +338,15 @@ inside nested parentheses. They are:
|
|||
:c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C
|
||||
variable(s).
|
||||
|
||||
``$``
|
||||
:c:func:`PyArg_ParseTupleAndKeywords` only:
|
||||
Indicates that the remaining arguments in the Python argument list are
|
||||
keyword-only. Currently, all keyword-only arguments must also be optional
|
||||
arguments, so ``|`` must always be specified before ``$`` in the format
|
||||
string.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
``:``
|
||||
The list of format units ends here; the string after the colon is used as the
|
||||
function name in error messages (the "associated value" of the exception that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue