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

gh-74366: Fix the documentation of `$` in `PyArg_ParseTupleAndKeywords()` by serhiy-storchaka · Pull Request #155301 · python/cpython · GitHub

Repository navigation

gh-74366: Fix the documentation of $ in PyArg_ParseTupleAndKeywords() - #155301

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-74366-kwonly-doc
Aug 7, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-74366-kwonly-doc

Conversation

Copy link
Copy Markdown
Member

The documentation says that all keyword-only arguments must also be optional, so | must always be specified before $. This has never been true: if | is not specified before $, the keyword-only arguments are required. The wording dates back to the addition of $ in 3.3 (bpo-14328) and has not been touched since.

Document also that | cannot be specified after $, and add examples of format strings with the corresponding Python signatures.

…ywords()

The keyword-only arguments are not always optional: they are required if
"|" was not specified before "$".  Document also that "|" cannot be
specified after "$", and add examples for "|" and "$".

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33948853 | 📁 Comparing 2f19e5d against main (c3aefdb)

  🔍 Preview build  

1 file changed
± c-api/arg.html

serhiy-storchaka enabled auto-merge (squash) August 7, 2026 04:00
serhiy-storchaka merged commit af930c1 into python:main Aug 7, 2026
28 of 29 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Aug 7, 2026

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

bedevere-app Bot commented Aug 7, 2026

Copy link
Copy Markdown

GH-155308 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Aug 7, 2026

bedevere-app Bot commented Aug 7, 2026

Copy link
Copy Markdown

GH-155309 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 7, 2026

bedevere-app Bot commented Aug 7, 2026

Copy link
Copy Markdown

GH-155310 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 7, 2026
serhiy-storchaka added a commit that referenced this pull request Aug 7, 2026
…eywords() (GH-155301) (GH-155310)

The keyword-only arguments are not always optional: they are required if
"|" was not specified before "$".  Document also that "|" cannot be
specified after "$", and add examples for "|" and "$".
(cherry picked from commit af930c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Aug 7, 2026
…eywords() (GH-155301) (GH-155309)

The keyword-only arguments are not always optional: they are required if
"|" was not specified before "$".  Document also that "|" cannot be
specified after "$", and add examples for "|" and "$".
(cherry picked from commit af930c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
hugovk pushed a commit that referenced this pull request Aug 7, 2026
…eywords() (GH-155301) (#155308)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
…ywords() (pythonGH-155301)

The keyword-only arguments are not always optional: they are required if
"|" was not specified before "$".  Document also that "|" cannot be
specified after "$", and add examples for "|" and "$".
serhiy-storchaka deleted the gh-74366-kwonly-doc branch August 27, 2026 12:40
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL