diff options
author | Larry Hastings <larry@hastings.org> | 2012-03-20 20:06:16 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2012-03-20 20:06:16 (GMT) |
commit | 83a9f4869958f992b2964404f43dcc596c5a7892 (patch) | |
tree | 2fcd7a09a5b14d67ead54dd827872d9cecff75b5 /Doc/c-api/arg.rst | |
parent | 2a886412ba8d7a197c55b15aa2d89530c0a2f68a (diff) | |
download | cpython-83a9f4869958f992b2964404f43dcc596c5a7892.zip cpython-83a9f4869958f992b2964404f43dcc596c5a7892.tar.gz cpython-83a9f4869958f992b2964404f43dcc596c5a7892.tar.bz2 |
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.
Diffstat (limited to 'Doc/c-api/arg.rst')
-rw-r--r-- | Doc/c-api/arg.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index 196aa77..f33714e 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -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 |