René's URL Explorer Experiment


Title: gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h by encukou · Pull Request #99014 · python/cpython · GitHub

Open Graph Title: gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h by encukou · Pull Request #99014 · python/cpython

X Title: gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h by encukou · Pull Request #99014 · python/cpython

Description: The structmember.h header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra include and non-namespaced macros bother you greatly). Specifically, no uses in CPython are updated -- that would just be unnecessary churn. The header's contents are now available just by including Python.h, with a PY_ prefix added if it was missing: PyMemberDef, PyMember_GetOne, PyMember_SetOne Type macros like PY_T_INT, PY_T_DOUBLE, etc. (previously T_INT, T_DOUBLE, etc.) The flags PY_READONLY (previously READONLY) and PY_AUDIT_READ (name unchanged) Several items are not exposed from Python.h: T_OBJECT (use PY_T_OBJECT_EX) T_NONE (previously undocumented, and pretty quirky) The macro WRITE_RESTRICTED which does nothing. The macros RESTRICTED and READ_RESTRICTED, equivalents of PY_AUDIT_READ. In some configurations, is not included from Python.h. It should be included manually when using offsetof(). The PY_T_*, PY_READONLY and PY_AUDIT_READ macros are added to the stable API manifest. This is just a clerical change, really -- Stable ABI extensions in the wild use structmember.h, and PyMemberDef & Py_tp_members are already listed. There is discussion on the issue to rename T_PYSSIZET to PY_T_SSIZE or similar. I chose not to do that -- users will probably copy/paste that with any spelling, and not renaming it makes migration docs simpler. Co-Authored-By: Alexander Belopolsky abalkin@users.noreply.github.com Co-Authored-By: Matthias Braun MatzeB@users.noreply.github.com Issue: gh-47146

Open Graph Description: The structmember.h header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra in...

X Description: The structmember.h header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra in...

Opengraph URL: https://github.com/python/cpython/pull/99014

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d6fef95a-7508-062a-66be-250668add88c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id89E4:378262:18CB8B4:20817FC:696B3121
html-safe-nonceef500711e5da41a13763ef97bfe8d577bab1632d3ab84689b66b75827df94bbb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUU0OjM3ODI2MjoxOENCOEI0OjIwODE3RkM6Njk2QjMxMjEiLCJ2aXNpdG9yX2lkIjoiNjY2MjA0ODQ5MTg1NDU3Mzg1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6d0351c60ac22fddfacf0faa28cb91aacc90809e7ee8abb30e26b50c24a52311
hovercard-subject-tagpull_request:1108540198
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/99014/files
twitter:imagehttps://avatars.githubusercontent.com/u/302922?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/302922?s=400&v=4
og:image:altThe structmember.h header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra in...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/99014/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99014%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99014%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/99014/files
Reloadhttps://github.com/python/cpython/pull/99014/files
Reloadhttps://github.com/python/cpython/pull/99014/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
encukouhttps://github.com/encukou
python:mainhttps://github.com/python/cpython/tree/main
encukou:structmember-publichttps://github.com/encukou/cpython/tree/structmember-public
Conversation 23 https://github.com/python/cpython/pull/99014
Commits 14 https://github.com/python/cpython/pull/99014/commits
Checks 0 https://github.com/python/cpython/pull/99014/checks
Files changed https://github.com/python/cpython/pull/99014/files
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h https://github.com/python/cpython/pull/99014/files#top
Show all changes 14 commits https://github.com/python/cpython/pull/99014/files
33e614a Move structmember.h definitions to descrobject.h, adding PY_ prefixes encukou Nov 2, 2022 https://github.com/python/cpython/pull/99014/commits/33e614abe9210a15df4d78e2691aec044de7796a
388c6ef Add to limited API encukou Nov 2, 2022 https://github.com/python/cpython/pull/99014/commits/388c6ef387f56cf6b4b0993eca9ad057dc1dd7e7
498365d All the docs encukou Nov 2, 2022 https://github.com/python/cpython/pull/99014/commits/498365df58ffebd3f6e7dce3a8bdcf3b54a22501
714bd57 NEWS & What's New encukou Nov 2, 2022 https://github.com/python/cpython/pull/99014/commits/714bd57338ac5be55a00b4648a7fbfd52d94ff19
9927fa2 Fix ReST syntax encukou Nov 2, 2022 https://github.com/python/cpython/pull/99014/commits/9927fa20020a9372207c6fe35cf2a897410e2826
26246d8 Change the prefix to `Py_`, per PEP 7 encukou Nov 8, 2022 https://github.com/python/cpython/pull/99014/commits/26246d8f6ee12759736a4158b34a30f714e43cc6
01b61a2 Add back PY_AUDIT_READ encukou Nov 8, 2022 https://github.com/python/cpython/pull/99014/commits/01b61a2d9ae2eedb8d53cd5afa40ce0389b8a9a8
f3e9765 Expose PyMember_?etOne in Limited API (again?) encukou Nov 8, 2022 https://github.com/python/cpython/pull/99014/commits/f3e9765f7a8cc924f15f9550957574a1b8ddd739
e6b626d Fix footnotes in docs encukou Nov 15, 2022 https://github.com/python/cpython/pull/99014/commits/e6b626dc7090a61480e71e738e31df09bd384528
3cb05e9 Merge main branch encukou Nov 15, 2022 https://github.com/python/cpython/pull/99014/commits/3cb05e9890c82ea1a5e87d4bdd7261a22addc74a
779d14e Use the right prefix in stable_abi.toml encukou Nov 15, 2022 https://github.com/python/cpython/pull/99014/commits/779d14e66cc19554973e07adca0411df78d7b431
e44b7ca Move tests to _testcapi/, add tests for the new API encukou Nov 15, 2022 https://github.com/python/cpython/pull/99014/commits/e44b7cae62c4d7b28022b225160957c69181a458
8f7609e Address review comments encukou Nov 21, 2022 https://github.com/python/cpython/pull/99014/commits/8f7609efa33c3b1ec868aa22168ed77b6cb6007f
88aa9a1 Merge in the main branch encukou Nov 21, 2022 https://github.com/python/cpython/pull/99014/commits/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da
Clear filters https://github.com/python/cpython/pull/99014/files
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
structures.rst https://github.com/python/cpython/pull/99014/files#diff-7cc88f3345d03aaf0505c8c85cf6912c43b87a16e124332e84059f1550061286
stable_abi.dat https://github.com/python/cpython/pull/99014/files#diff-e87eccb88c979495c493aed4127b9f9932c320edfe4d95c8e28e2ca92e8e33f3
newtypes.rst https://github.com/python/cpython/pull/99014/files#diff-fb096b2781b53f449f3853524f1fed5d86b9539ce83c4b3d1085ea220baad3d9
newtypes_tutorial.rst https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
custom2.c https://github.com/python/cpython/pull/99014/files#diff-205fa8c16a258a2116b12e38bfc69b88b8cf2c6412ce0cc256f5d3e48cb165cf
custom3.c https://github.com/python/cpython/pull/99014/files#diff-3ee128974bffae61ed301477efba310dd1b4a1a646fe24acdb08a5ff3a03ddc0
custom4.c https://github.com/python/cpython/pull/99014/files#diff-40da1923100408b1114041ee458362ce4e301ba5bb6fa7e84a3ba2ad5668129b
3.12.rst https://github.com/python/cpython/pull/99014/files#diff-0f2c1763c64530268325a0ee2dfaa4f5d555c4ac27deb78bd77102c8ce1b886b
descrobject.h https://github.com/python/cpython/pull/99014/files#diff-b68a6d837599eb6c5aa44d496408b0f3cef47dc81d84de03ebcff3212e63f9a8
structmember.h https://github.com/python/cpython/pull/99014/files#diff-cbeba16ccdc96085092a87509c4d93f850efda3174337905a43939b4ba76bdc7
test_structmembers.py https://github.com/python/cpython/pull/99014/files#diff-4eba0fd3bdb8579321fdebdb90cbf994a0eefde0eaed939a7b1dcdda0e2212f7
2022-11-02-16-51-24.gh-issue-47146.dsYDtI.rst https://github.com/python/cpython/pull/99014/files#diff-3a74114b569b122486704cb95dc5eb9cb5b562d10547346f74c1379e9e0cc398
stable_abi.toml https://github.com/python/cpython/pull/99014/files#diff-f098b9ddf231fb279a9f5b4b8ed22c4241e1ffed7fe0deffb2c76bb2126d2911
Setup.stdlib.in https://github.com/python/cpython/pull/99014/files#diff-93b54a98829ea89eaf6335c02f546511f7780d865131407436b10a401ecd375c
parts.h https://github.com/python/cpython/pull/99014/files#diff-cda7cf7eb449238a999023ecd2b9e421c402b83d4ab7a16d2bf9cce68dad32ba
structmember.c https://github.com/python/cpython/pull/99014/files#diff-7bd5f4b3ca74bdc9dd5abc1f91dff91ea5c1c2097c7f1bb77ffba7e8612bf9bb
_testcapimodule.c https://github.com/python/cpython/pull/99014/files#diff-b2d7540efa4f376350ef77b923a6dfcc54bb90424970477f66275f19bad0d30f
_testcapi.vcxproj https://github.com/python/cpython/pull/99014/files#diff-84a64a18e83c2b6057a2eb75ee9c6bf2695a4948b62f8bd268a0f4f46d774830
_testcapi.vcxproj.filters https://github.com/python/cpython/pull/99014/files#diff-5772d42704a7c3ceafeaabcda5f995cb70bd48acd70c9c4d2e5bf2319a706bb3
Doc/c-api/structures.rsthttps://github.com/python/cpython/pull/99014/files#diff-7cc88f3345d03aaf0505c8c85cf6912c43b87a16e124332e84059f1550061286
View file https://github.com/encukou/cpython/blob/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da/Doc/c-api/structures.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/99014/{{ revealButtonHref }}
https://github.com/python/cpython/pull/99014/files#diff-7cc88f3345d03aaf0505c8c85cf6912c43b87a16e124332e84059f1550061286
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
https://github.com/python/cpython/pull/99014/files#diff-7cc88f3345d03aaf0505c8c85cf6912c43b87a16e124332e84059f1550061286
Doc/data/stable_abi.dathttps://github.com/python/cpython/pull/99014/files#diff-e87eccb88c979495c493aed4127b9f9932c320edfe4d95c8e28e2ca92e8e33f3
View file https://github.com/encukou/cpython/blob/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da/Doc/data/stable_abi.dat
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
Doc/extending/newtypes.rsthttps://github.com/python/cpython/pull/99014/files#diff-fb096b2781b53f449f3853524f1fed5d86b9539ce83c4b3d1085ea220baad3d9
View file https://github.com/encukou/cpython/blob/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da/Doc/extending/newtypes.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/99014/{{ revealButtonHref }}
https://github.com/python/cpython/pull/99014/files#diff-fb096b2781b53f449f3853524f1fed5d86b9539ce83c4b3d1085ea220baad3d9
https://github.com/python/cpython/pull/99014/files#diff-fb096b2781b53f449f3853524f1fed5d86b9539ce83c4b3d1085ea220baad3d9
Doc/extending/newtypes_tutorial.rsthttps://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
View file https://github.com/encukou/cpython/blob/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da/Doc/extending/newtypes_tutorial.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/99014/{{ revealButtonHref }}
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
https://github.com/python/cpython/pull/99014/files#diff-9c878c16f54b6d3bc875b4edf60bdd4f26a2c5ee4b773dded4ae57dd3a80e3ae
Doc/includes/custom2.chttps://github.com/python/cpython/pull/99014/files#diff-205fa8c16a258a2116b12e38bfc69b88b8cf2c6412ce0cc256f5d3e48cb165cf
View file https://github.com/encukou/cpython/blob/88aa9a1cf6f1871a4f7c90661bc429b8a84aa8da/Doc/includes/custom2.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/99014/{{ revealButtonHref }}
https://github.com/python/cpython/pull/99014/files#diff-205fa8c16a258a2116b12e38bfc69b88b8cf2c6412ce0cc256f5d3e48cb165cf
https://github.com/python/cpython/pull/99014/files#diff-205fa8c16a258a2116b12e38bfc69b88b8cf2c6412ce0cc256f5d3e48cb165cf
https://github.com/python/cpython/pull/99014/files#diff-205fa8c16a258a2116b12e38bfc69b88b8cf2c6412ce0cc256f5d3e48cb165cf
Please reload this pagehttps://github.com/python/cpython/pull/99014/files
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.