René's URL Explorer Experiment


Title: Add thread safety annotations for C API functions · Issue #145254 · python/cpython · GitHub

Open Graph Title: Add thread safety annotations for C API functions · Issue #145254 · python/cpython

X Title: Add thread safety annotations for C API functions · Issue #145254 · python/cpython

Description: Documentation CPython's C API documentation has no systematic way to communicate the thread safety guarantees of individual APIs. As the free-threaded build matures, this information is increasingly important for extension authors. This ...

Open Graph Description: Documentation CPython's C API documentation has no systematic way to communicate the thread safety guarantees of individual APIs. As the free-threaded build matures, this information is increasingl...

X Description: Documentation CPython's C API documentation has no systematic way to communicate the thread safety guarantees of individual APIs. As the free-threaded build matures, this information is increas...

Opengraph URL: https://github.com/python/cpython/issues/145254

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add thread safety annotations for C API functions","articleBody":"### Documentation\n\nCPython's C API documentation has no systematic way to communicate the thread safety guarantees of individual APIs. As the free-threaded build matures, this information is increasingly important for extension authors.\n\nThis is analogous to how return value ownership is documented today, with automatically-inserted \"Return value: New reference.\" / \"Return value: Borrowed reference.\" annotations. We should do the same for thread safety.\n\n#### Proposed levels\n\nThree levels, ordered from least to most safe:\n\n- **Thread-incompatible**: Not safe even with external locking\n- **Thread-compatible**: Safe if the caller serializes all access with external locks\n- **Safe**: Safe to call from multiple threads on shared objects\n\nEach annotation links to the corresponding glossary term. The `thread-safe` term already exists in the glossary, `thread-compatible` and `thread-incompatible` would be added.\n\nI have PRs ready for both CPython and python-docs-theme. Feedback welcome, especially on the choice and naming of levels.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-145255\n* gh-145862\n* gh-146111\n* gh-146163\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/lysnikolaou","@type":"Person","name":"lysnikolaou"},"datePublished":"2026-02-26T13:35:06Z","url":"https://github.com/python/cpython/issues/145254"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4a91e794-c599-4206-99f9-6076b6d8ceb2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD1F0:399E4B:375B439:4970017:6B020208
html-safe-noncebc725e43fea825b8a6df09a8285361eb9c2739437e2d0adbeb6a22c019b3f50c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUYwOjM5OUU0QjozNzVCNDM5OjQ5NzAwMTc6NkIwMjAyMDgiLCJ2aXNpdG9yX2lkIjoiODY5MzE3NDU5NTI5NDk4Njc2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf8274635c8046ed646fb8f81d9d679f644b8df060a353c05e56a7dde366e17a3
hovercard-subject-tagissue:3995616758
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/145254/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7f8cdf042713514ae55b7d0a67e7fc8ae93e27462a04718c206d31ee40a95d02/python/cpython/issues/145254
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7f8cdf042713514ae55b7d0a67e7fc8ae93e27462a04718c206d31ee40a95d02/python/cpython/issues/145254
og:image:altDocumentation CPython's C API documentation has no systematic way to communicate the thread safety guarantees of individual APIs. As the free-threaded build matures, this information is increasingl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelysnikolaou
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/145254#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F145254
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F145254
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/145254
Reloadhttps://github.com/python/cpython/issues/145254
Reloadhttps://github.com/python/cpython/issues/145254
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/145254
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/145254
Add thread safety annotations for C API functionshttps://github.com/python/cpython/issues/145254#top
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
https://github.com/lysnikolaou
lysnikolaouhttps://github.com/lysnikolaou
on Feb 26, 2026https://github.com/python/cpython/issues/145254#issue-3995616758
gh-145254: Add thread safety annotation #145255https://github.com/python/cpython/pull/145255
[3.14] gh-145254: Add thread safety annotation in docs (GH-145255) #145862https://github.com/python/cpython/pull/145862
gh-145254: Fix formatting of thread safety annotations #146111https://github.com/python/cpython/pull/146111
[3.14] gh-145254: Fix formatting of thread safety annotations (GH-146111) #146163https://github.com/python/cpython/pull/146163
lysnikolaouhttps://github.com/lysnikolaou
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
on Feb 26, 2026https://github.com/python/cpython/issues/145254#event-23103805962
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Feb 26, 2026https://github.com/python/cpython/issues/145254#event-23103806745
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Feb 26, 2026https://github.com/python/cpython/issues/145254
lysnikolaouhttps://github.com/lysnikolaou
on Feb 26, 2026https://github.com/python/cpython/issues/145254#event-23103819651
pythongh-145254: Add thread safety annotationhttps://github.com/lysnikolaou/cpython/commit/a270317becadb92e680e8ebaa5988ffc0da72bb6
pythongh-145254https://github.com/python/cpython/issues/145254
a270317https://github.com/lysnikolaou/cpython/commit/a270317becadb92e680e8ebaa5988ffc0da72bb6
StanFromIrelandhttps://github.com/StanFromIreland
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
on Feb 26, 2026https://github.com/python/cpython/issues/145254#event-23108123586
https://github.com/lysnikolaou
lysnikolaouhttps://github.com/lysnikolaou
on Mar 6, 2026https://github.com/python/cpython/issues/145254#issuecomment-4011817864
kumaraditya303https://github.com/kumaraditya303
on Mar 12, 2026https://github.com/python/cpython/issues/145254#event-23495876131
gh-145254: Add thread safety annotation in docs (#145255)https://github.com/python/cpython/commit/0dce4c6eab9dcfcb44bb2739dc60c8ac5fa1ebad
gh-145254https://github.com/python/cpython/issues/145254
#145255https://github.com/python/cpython/pull/145255
0dce4c6https://github.com/python/cpython/commit/0dce4c6eab9dcfcb44bb2739dc60c8ac5fa1ebad
miss-islingtonhttps://github.com/miss-islington
on Mar 12, 2026https://github.com/python/cpython/issues/145254#event-23507900764
pythongh-145254: Add thread safety annotation in docs (pythonGH-145255)https://github.com/miss-islington/cpython/commit/2ae998f4e897ca872ee031b2b0ed08f664ab4e82
pythongh-145254https://github.com/python/cpython/issues/145254
pythonGH-145255https://github.com/python/cpython/pull/145255
2ae998fhttps://github.com/miss-islington/cpython/commit/2ae998f4e897ca872ee031b2b0ed08f664ab4e82
hugovkhttps://github.com/hugovk
on Mar 12, 2026https://github.com/python/cpython/issues/145254#event-23508296995
[3.14] gh-145254: Add thread safety annotation in docs (GH-145255) (#…https://github.com/python/cpython/commit/f9589cb1b26c1f9d7cd0fe823ba211ea6c5804cd
gh-145254https://github.com/python/cpython/issues/145254
GH-145255https://github.com/python/cpython/pull/145255
#…https://github.com/python/cpython/pull/145862
f9589cbhttps://github.com/python/cpython/commit/f9589cb1b26c1f9d7cd0fe823ba211ea6c5804cd
lysnikolaouhttps://github.com/lysnikolaou
on Mar 18, 2026https://github.com/python/cpython/issues/145254#event-23683800596
pythongh-145254: Fix formatting of thread safety annotationshttps://github.com/lysnikolaou/cpython/commit/3134454a033c442411f63891f0c2594cec255b37
pythongh-145254https://github.com/python/cpython/issues/145254
3134454https://github.com/lysnikolaou/cpython/commit/3134454a033c442411f63891f0c2594cec255b37
pythongh-145254: Fix formatting of thread safety annotationshttps://github.com/lysnikolaou/cpython/commit/01b9e9ef60cf9833ccd144dca566b71818673397
pythongh-145254https://github.com/python/cpython/issues/145254
01b9e9ehttps://github.com/lysnikolaou/cpython/commit/01b9e9ef60cf9833ccd144dca566b71818673397
gh-145254: Fix formatting of thread safety annotations (#146111)https://github.com/python/cpython/commit/580043dfae90331de15cf1504d09e2c7216182a6
gh-145254https://github.com/python/cpython/issues/145254
#146111https://github.com/python/cpython/pull/146111
580043dhttps://github.com/python/cpython/commit/580043dfae90331de15cf1504d09e2c7216182a6
miss-islingtonhttps://github.com/miss-islington
on Mar 19, 2026https://github.com/python/cpython/issues/145254#event-23713630186
pythongh-145254: Fix formatting of thread safety annotations (pythonG…https://github.com/miss-islington/cpython/commit/79a3c38ee93a1ca69cff3af7bbf822c1a8270e22
pythongh-145254https://github.com/python/cpython/issues/145254
pythonG…https://github.com/python/cpython/pull/146111
79a3c38https://github.com/miss-islington/cpython/commit/79a3c38ee93a1ca69cff3af7bbf822c1a8270e22
lysnikolaouhttps://github.com/lysnikolaou
on Mar 19, 2026https://github.com/python/cpython/issues/145254#event-23713841346
[3.14] gh-145254: Fix formatting of thread safety annotations (GH-146111https://github.com/python/cpython/commit/cfdc5e86dde549bac97b8c61b1089d890ca1aaf3
gh-145254https://github.com/python/cpython/issues/145254
GH-146111https://github.com/python/cpython/pull/146111
cfdc5e8https://github.com/python/cpython/commit/cfdc5e86dde549bac97b8c61b1089d890ca1aaf3
kumaraditya303https://github.com/kumaraditya303
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 11, 2026https://github.com/python/cpython/issues/145254#event-24409695423
ljfphttps://github.com/ljfp
on Apr 25, 2026https://github.com/python/cpython/issues/145254#event-24868326138
pythongh-145254: Add thread safety annotation in docs (python#145255)https://github.com/ljfp/cpython/commit/f9334fac0b9a78b5ee6e97df80e6a2c4e344236d
pythongh-145254https://github.com/python/cpython/issues/145254
python#145255https://github.com/python/cpython/pull/145255
f9334fahttps://github.com/ljfp/cpython/commit/f9334fac0b9a78b5ee6e97df80e6a2c4e344236d
pythongh-145254: Fix formatting of thread safety annotations (python#…https://github.com/ljfp/cpython/commit/c082edf1094f61f91048e3df882a6c5c54534a05
pythongh-145254https://github.com/python/cpython/issues/145254
python#…https://github.com/python/cpython/pull/146111
c082edfhttps://github.com/ljfp/cpython/commit/c082edf1094f61f91048e3df882a6c5c54534a05
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/145254
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/145254
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
docs issueshttps://github.com/orgs/python/projects/52
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.