Skip to content

[3.13] Docs: C API: Fix the incorrect PyThreadState_Swap documentation - #133900

Merged
kumaraditya303 merged 1 commit into
python:3.13from
ZeroIntensity:313-fix-tstate-swap
May 19, 2025
Merged

[3.13] Docs: C API: Fix the incorrect PyThreadState_Swap documentation#133900
kumaraditya303 merged 1 commit into
python:3.13from
ZeroIntensity:313-fix-tstate-swap

Conversation

@ZeroIntensity

@ZeroIntensityZeroIntensity commented May 11, 2025

Copy link
Copy Markdown
Member

I've already fixed this for main and 3.14 in gh-127990, but that wasn't backported to 3.13. I'm not planning on fixing any other 3.13 docs, but PyThreadState_Swap is especially bad, because the documentation says you need to hold the GIL to call it, which is wrong and would defeat the whole point of the function if it were true. I've seen people get confused by that on several different occasions.


📚 Documentation preview 📚: https://cpython-previews--133900.org.readthedocs.build/en/133900/c-api/init.html#c.PyThreadState_Swap

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

Labels

docsDocumentation in the Doc dirskip issueskip newstopic-C-API

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@ZeroIntensity@kumaraditya303