Skip to content

gh-1253: Rewrite the generated code check in the Argument Clinic tutorial - #1988

Open
VanshajPoonia wants to merge 1 commit into
python:mainfrom
VanshajPoonia:docs/1253-clinic-tutorial-check
Open

VanshajPoonia wants to merge 1 commit into
python:mainfrom
VanshajPoonia:docs/1253-clinic-tutorial-check

Conversation

@VanshajPoonia

Copy link
Copy Markdown

Closes #1253.

The tutorial said to check that the code Argument Clinic generates uses the same PyArg_Parse function and format string as the old code. Most converters now generate direct code, so those checks no longer apply.

I rewrote the check to compare behavior. First the signature line in the generated docstring. Then the METHODDEF macro and which METH_ flags clinic picks. Then the accepted positional count, keywords and C types. The format string comparison stays for the fallback case where clinic still emits one PyArg_Parse call.

I did not run clinic.py. Every output snippet is copied from files checked in to CPython. make html gives the same 25 warnings as main and none from the clinic pages.

…c tutorial

The section told readers to compare the generated code with their old PyArg_Parse* call. Clinic no longer generates that call for most converters. It now says what to check instead.
@python-cla-bot

python-cla-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CPython devguide | 🛠️ Build #36162188 | 📁 Comparing bbc6f12 against latest (e97d25f)

  🔍 Preview build  

1 file changed
± development-tools/clinic/tutorial/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Argument clinic: outdated tutorial

1 participant