FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-74366: Fix the documentation of "$" in PyArg_ParseTupleAndKeywords() (GH-155301) by miss-islington · Pull Request #155310 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 8 additions & 3 deletions Doc/c-api/arg.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,18 @@ inside nested parentheses. They are:
their default value --- when an optional argument is not specified,
:c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C
variable(s).
For example, the format string ``"OO|OO"`` corresponds to the Python
signature ``f(a, b, c=None, d=None)``.

``$``
: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.
keyword-only.
They are optional if ``|`` was specified before ``$``, and required otherwise.
``|`` cannot be specified after ``$``.
For example, the format string ``"O|O$O"`` corresponds to the Python
signature ``f(a, b=None, *, c=None)``,
and the format string ``"OO$OO"`` corresponds to ``f(a, b, *, c, d)``.

.. versionadded:: 3.3

Expand Down
Loading

Back | FazBrowse Home | New Git URL