| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 606df1b commit 51c38ff
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -399,13 +399,18 @@ inside nested parentheses. They are: | |||
| 399 | 399 | their default value --- when an optional argument is not specified, | |
| 400 | 400 | :c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C | |
| 401 | 401 | variable(s). | |
| 402 | + For example, the format string ``"OO|OO"`` corresponds to the Python | ||
| 403 | + signature ``f(a, b, c=None, d=None)``. | ||
| 402 | 404 | ||
| 403 | 405 | ``$`` | |
| 404 | 406 | :c:func:`PyArg_ParseTupleAndKeywords` only: | |
| 405 | 407 | Indicates that the remaining arguments in the Python argument list are | |
| 406 | - keyword-only. Currently, all keyword-only arguments must also be optional | ||
| 407 | - arguments, so ``|`` must always be specified before ``$`` in the format | ||
| 408 | - string. | ||
| 408 | + keyword-only. | ||
| 409 | + They are optional if ``|`` was specified before ``$``, and required otherwise. | ||
| 410 | + ``|`` cannot be specified after ``$``. | ||
| 411 | + For example, the format string ``"O|O$O"`` corresponds to the Python | ||
| 412 | + signature ``f(a, b=None, *, c=None)``, | ||
| 413 | + and the format string ``"OO$OO"`` corresponds to ``f(a, b, *, c, d)``. | ||
| 409 | 414 | ||
| 410 | 415 | .. versionadded:: 3.3 | |
| 411 | 416 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments