René's URL Explorer Experiment


Title: gh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types by picnixz · Pull Request #138582 · python/cpython · GitHub

Open Graph Title: gh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types by picnixz · Pull Request #138582 · python/cpython

X Title: gh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types by picnixz · Pull Request #138582 · python/cpython

Description: This only adds the Py_TPFLAGS_IMMUTABLETYPE flag and assumes that other GC-related issues are solved (not all types are actually empty). I've added NEWS entries just because we also mention transforming extension modules from single-phase to multi-phase. It doesn't hurt mentioning this if a type can be observed with obj = public_func(); print(type(obj)). @serhiy-storchaka Can I split the PR for immutable types into those that are in _test*api and xxlimited* with those that are used in release builds? There is just one type _interpreters.CrossInterpreterBufferView that I'm unsure of. @pablogsal Am I correct to assume that _remote_debugging.RemoteUnwinder should be immutable and is really internal? It's only "publicly" accessible through profiling.sampling.SampleProfiler.unwinder but I don't know if it's meant to be used externally. Issue: gh-116946

Open Graph Description: This only adds the Py_TPFLAGS_IMMUTABLETYPE flag and assumes that other GC-related issues are solved (not all types are actually empty). I've added NEWS entries just because we also mention tra...

X Description: This only adds the Py_TPFLAGS_IMMUTABLETYPE flag and assumes that other GC-related issues are solved (not all types are actually empty). I've added NEWS entries just because we also mention...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:36d51358-a11b-f4ed-19bf-d8ad196c088e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC416:2265AE:E3ED4B:13AE426:696A915C
html-safe-nonceecd4ec4e5dfe99e0ce2957710204c57046162eb15de6621875be802decde4841
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDE2OjIyNjVBRTpFM0VENEI6MTNBRTQyNjo2OTZBOTE1QyIsInZpc2l0b3JfaWQiOiI1NDQzOTY3Nzc2NDA3MDY0OTI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2353142c3bae3f27008016cc0490cfd96f0871b5099192483b3731943d191d6e
hovercard-subject-tagpull_request:2804917075
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/138582/files
twitter:imagehttps://avatars.githubusercontent.com/u/10796600?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10796600?s=400&v=4
og:image:altThis only adds the Py_TPFLAGS_IMMUTABLETYPE flag and assumes that other GC-related issues are solved (not all types are actually empty). I've added NEWS entries just because we also mention tra...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7
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
release31496a13b80a2f6ad77d6c617ee2255a3545b539
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/138582/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F138582%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%2F138582%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/138582/files
Reloadhttps://github.com/python/cpython/pull/138582/files
Reloadhttps://github.com/python/cpython/pull/138582/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/138582/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/138582/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
picnixzhttps://github.com/picnixz
python:mainhttps://github.com/python/cpython/tree/main
picnixz:feat/gc/immutable-heap-types-116946https://github.com/picnixz/cpython/tree/feat/gc/immutable-heap-types-116946
Conversation 5 https://github.com/python/cpython/pull/138582
Commits 10 https://github.com/python/cpython/pull/138582/commits
Checks 47 https://github.com/python/cpython/pull/138582/checks
Files changed https://github.com/python/cpython/pull/138582/files
Please reload this pagehttps://github.com/python/cpython/pull/138582/files
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types https://github.com/python/cpython/pull/138582/files#top
Show all changes 10 commits https://github.com/python/cpython/pull/138582/files
53c9fe8 make `_tkinter.Tcl_Obj` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/53c9fe80cceeb997767c2eab2f5f11eda6f502ee
8db0113 make `_curses_panel.panel` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/8db011335e99bc21231ad3dfa3559c00e418fdcb
c7213ac make `_tkinter.tkapp` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/c7213ac07acec82651c081ba764cf184c1a9ed4f
443908f make `_tkinter.tktimertoken` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/443908f582add0bc17e8383b16b9ad405e5e5198
2ceb790 make `zlib.Compress` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/2ceb790da6d6c32482b8ed67ea6b3231bfc35715
2b0f8ef make `zlib.Decompress` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/2b0f8efaa337109c760964d185c84cd36e5bd497
ba55263 make `[posix,nt].ScandirIterator` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/ba552636c4bcba0ae0e5b7d3f3bd3376ee156219
934432e make `[posix,nt].DirEntry` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/934432e15e380144836541796c518ac0a907f6ad
60f9545 make `_remote_debugging.RemoteUnwinder` immutable picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/60f9545097083445e0fed70e05929b108bc191dc
6405c1c blurb picnixz Sep 6, 2025 https://github.com/python/cpython/pull/138582/commits/6405c1cbe556e6a2026595c03084f309b7b57bf3
Clear filters https://github.com/python/cpython/pull/138582/files
Please reload this pagehttps://github.com/python/cpython/pull/138582/files
Please reload this pagehttps://github.com/python/cpython/pull/138582/files
2025-09-06-14-47-23.gh-issue-116946.hj_u1t.rst https://github.com/python/cpython/pull/138582/files#diff-4d7ff5c9c256741f79b6ebfee1cd7b973ab64ea18b40b01c076b20d059ca9193
2025-09-06-14-53-19.gh-issue-116946.c-npxd.rst https://github.com/python/cpython/pull/138582/files#diff-041752bacf36fc0f9b3f372f415e1d73ab6d53684bee16465217bc334d1166e7
2025-09-06-14-54-01.gh-issue-116946.hzQEWI.rst https://github.com/python/cpython/pull/138582/files#diff-97171262988a2939c406a9f60fb991a42cf195cd318097f33842de3103bfa437
2025-09-06-14-56-40.gh-issue-116946.GGIeyO.rst https://github.com/python/cpython/pull/138582/files#diff-d547106be5ec38ab1631949c51c78556492f3f15250027fc13aba90785dc1725
_curses_panel.c https://github.com/python/cpython/pull/138582/files#diff-23094b5d60e96c7e35b72a31edc3598c80f6063956b0098d867dd43c613cb5a5
_remote_debugging_module.c https://github.com/python/cpython/pull/138582/files#diff-5a1d64231de6c64b102a221f5a66780b279045b7e9ca4b37fbc3ed172ed75f32
_tkinter.c https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
posixmodule.c https://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
zlibmodule.c https://github.com/python/cpython/pull/138582/files#diff-295b58a9ad1abea83244636cd413e54a5114dcaf34df95f8ca5db806fc6ab188
Misc/NEWS.d/next/Library/2025-09-06-14-47-23.gh-issue-116946.hj_u1t.rsthttps://github.com/python/cpython/pull/138582/files#diff-4d7ff5c9c256741f79b6ebfee1cd7b973ab64ea18b40b01c076b20d059ca9193
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Misc/NEWS.d/next/Library/2025-09-06-14-47-23.gh-issue-116946.hj_u1t.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
Misc/NEWS.d/next/Library/2025-09-06-14-53-19.gh-issue-116946.c-npxd.rsthttps://github.com/python/cpython/pull/138582/files#diff-041752bacf36fc0f9b3f372f415e1d73ab6d53684bee16465217bc334d1166e7
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Misc/NEWS.d/next/Library/2025-09-06-14-53-19.gh-issue-116946.c-npxd.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
Misc/NEWS.d/next/Library/2025-09-06-14-54-01.gh-issue-116946.hzQEWI.rsthttps://github.com/python/cpython/pull/138582/files#diff-97171262988a2939c406a9f60fb991a42cf195cd318097f33842de3103bfa437
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Misc/NEWS.d/next/Library/2025-09-06-14-54-01.gh-issue-116946.hzQEWI.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
Misc/NEWS.d/next/Library/2025-09-06-14-56-40.gh-issue-116946.GGIeyO.rsthttps://github.com/python/cpython/pull/138582/files#diff-d547106be5ec38ab1631949c51c78556492f3f15250027fc13aba90785dc1725
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Misc/NEWS.d/next/Library/2025-09-06-14-56-40.gh-issue-116946.GGIeyO.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
Modules/_curses_panel.chttps://github.com/python/cpython/pull/138582/files#diff-23094b5d60e96c7e35b72a31edc3598c80f6063956b0098d867dd43c613cb5a5
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Modules/_curses_panel.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138582/files#diff-23094b5d60e96c7e35b72a31edc3598c80f6063956b0098d867dd43c613cb5a5
https://github.com/python/cpython/pull/138582/files#diff-23094b5d60e96c7e35b72a31edc3598c80f6063956b0098d867dd43c613cb5a5
Modules/_remote_debugging_module.chttps://github.com/python/cpython/pull/138582/files#diff-5a1d64231de6c64b102a221f5a66780b279045b7e9ca4b37fbc3ed172ed75f32
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Modules/_remote_debugging_module.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138582/files#diff-5a1d64231de6c64b102a221f5a66780b279045b7e9ca4b37fbc3ed172ed75f32
https://github.com/python/cpython/pull/138582/files#diff-5a1d64231de6c64b102a221f5a66780b279045b7e9ca4b37fbc3ed172ed75f32
Modules/_tkinter.chttps://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Modules/_tkinter.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
https://github.com/python/cpython/pull/138582/files#diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd
Modules/posixmodule.chttps://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Modules/posixmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/138582/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
Modules/zlibmodule.chttps://github.com/python/cpython/pull/138582/files#diff-295b58a9ad1abea83244636cd413e54a5114dcaf34df95f8ca5db806fc6ab188
View file https://github.com/picnixz/cpython/blob/6405c1cbe556e6a2026595c03084f309b7b57bf3/Modules/zlibmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138582/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138582/files#diff-295b58a9ad1abea83244636cd413e54a5114dcaf34df95f8ca5db806fc6ab188
https://github.com/python/cpython/pull/138582/files#diff-295b58a9ad1abea83244636cd413e54a5114dcaf34df95f8ca5db806fc6ab188
https://github.com/python/cpython/pull/138582/files#diff-295b58a9ad1abea83244636cd413e54a5114dcaf34df95f8ca5db806fc6ab188
Please reload this pagehttps://github.com/python/cpython/pull/138582/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.