René's URL Explorer Experiment


Title: gh-117142: ctypes: Migrate global vars to module state by neonene · Pull Request #117189 · python/cpython · GitHub

Open Graph Title: gh-117142: ctypes: Migrate global vars to module state by neonene · Pull Request #117189 · python/cpython

X Title: gh-117142: ctypes: Migrate global vars to module state by neonene · Pull Request #117189 · python/cpython

Description: Separated PR from #117181, keeping global state access: Move global variables into the global state Call functions with the global state attached I think almost all diffs can be checked mechanically by C compilers except stylistic changes at 9342336. Unfixed global variables: File / Func Var name Possible fix malloc_closure.c Py_ffi_closure_alloc() Py_ffi_closure_free() free_list Move to module-state orthunk type-state, used by: _ctypes_alloc_callback() CThunkObject_dealloc() malloc_closure.c _pagesize Reload DLL if necessary cfield.c _ctypes_get_fielddesc() initialized Reload DLL if necessary cfield.c _ctypes_get_fielddesc() formattable Reload DLL if necessary callbacks.c Call_GetClassObject() context (unreachable) Do not intern (unused str?) callbacks.c Call_CanUnloadNow() context (unreachable) Do not intern (unused str?) Issue: gh-117142

Open Graph Description: Separated PR from #117181, keeping global state access: Move global variables into the global state Call functions with the global state attached I think almost all diffs can be checked mechanica...

X Description: Separated PR from #117181, keeping global state access: Move global variables into the global state Call functions with the global state attached I think almost all diffs can be checked mechanica...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:60943999-bf14-05af-0e7b-80f78b5f78d7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB5C:29F0EF:6705BA4:8C9C895:6995EAAD
html-safe-nonce04a9a44a2f5c3491000de4442a780cd46a11ccf36eb413202ceea5472c9174af
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjVDOjI5RjBFRjo2NzA1QkE0OjhDOUM4OTU6Njk5NUVBQUQiLCJ2aXNpdG9yX2lkIjoiNDQ3OTk2MjQ0ODQyNzA4NDQ2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7b8290e1499279654533b0727727bf4401e0a24fadc41213f6fd631902148d13
hovercard-subject-tagpull_request:1788079536
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
twitter:imagehttps://avatars.githubusercontent.com/u/53406459?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/53406459?s=400&v=4
og:image:altSeparated PR from #117181, keeping global state access: Move global variables into the global state Call functions with the global state attached I think almost all diffs can be checked mechanica...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1161b1e91d57e776171599ebe7c3b8c4690792d1e87e83b5c77a9b1aeb391094
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea8c6902042885fe21ac3491e553d741a50765a66
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F117189%2Fcommits%2F2c8974bb260010c284bf9ffa959ece6f49032620
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%2F117189%2Fcommits%2F2c8974bb260010c284bf9ffa959ece6f49032620
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%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Reloadhttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Reloadhttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.6k 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 0 https://github.com/python/cpython/security
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
Conversation 8 https://github.com/python/cpython/pull/117189
Commits 12 https://github.com/python/cpython/pull/117189/commits
Checks 0 https://github.com/python/cpython/pull/117189/checks
Files changed https://github.com/python/cpython/pull/117189/files
Please reload this pagehttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
gh-117142: ctypes: Migrate global vars to module state https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#top
Show all changes 12 commits https://github.com/python/cpython/pull/117189/files
cec5ea2 add test neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/cec5ea268b02a27b442704cdf3e137caf07cfa8f
c20a8d5 move global vars to global state neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/c20a8d5bc2c24f592826a5c98c64e2a20e46e12f
2feb008 globals-to-fix.tsv neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/2feb00856bb426f29d0eebc1f9f0f11328e41b9e
cb9e97d prepend module state to func args neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/cb9e97dfad44589511f3ddf474bc76dcaa6917ac
b1e5629 split GenericPyCData_new() neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/b1e56290673e0245ec6ec65c1518a032a49f3366
b2adc1f add missing function arg: module neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/b2adc1ffdf75520be1b9beee6c43ba8f0aecaab0
9342336 un-Yoda cond, curly braces neonene Mar 24, 2024 https://github.com/python/cpython/pull/117189/commits/9342336b29f4f0594ac8a5fb82e5ea5d99419143
5767fc7 fix blank neonene Mar 25, 2024 https://github.com/python/cpython/pull/117189/commits/5767fc78927ada1e6b96f672989875a774521a52
886acea Merge branch 'main' into ctypes_func neonene Mar 25, 2024 https://github.com/python/cpython/pull/117189/commits/886aceae68d2f6712253e1e253c9bf33c26df4c3
2c8974b revert cec5ea2 (unnecessary test here) neonene Mar 25, 2024 https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
52303c5 restore create_pointer_type(NULL, ... neonene Mar 29, 2024 https://github.com/python/cpython/pull/117189/commits/52303c5456197debc8f3d293d5fb031bbc216742
44b6095 rename: generic_pycdata_new() neonene Mar 29, 2024 https://github.com/python/cpython/pull/117189/commits/44b6095f6ae24d3f6b8f103eccecc1061f4f24dd
Clear filters https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Please reload this pagehttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Please reload this pagehttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
Prev https://github.com/python/cpython/pull/117189/commits/886aceae68d2f6712253e1e253c9bf33c26df4c3
Next https://github.com/python/cpython/pull/117189/commits/52303c5456197debc8f3d293d5fb031bbc216742
Please reload this pagehttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620
https://github.com/neonene
neonenehttps://github.com/python/cpython/commits?author=neonene
Lib/test/test_ctypes/test_refcounts.pyhttps://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#diff-fe959fb34f64335a7bd04ae7a5b70bbc18da8681cf0b42d67a5a714eb5f86b35
View file https://github.com/python/cpython/blob/2c8974bb260010c284bf9ffa959ece6f49032620/Lib/test/test_ctypes/test_refcounts.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117189/commits/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#diff-fe959fb34f64335a7bd04ae7a5b70bbc18da8681cf0b42d67a5a714eb5f86b35
https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#diff-fe959fb34f64335a7bd04ae7a5b70bbc18da8681cf0b42d67a5a714eb5f86b35
https://github.com/python/cpython/pull/117189/commits/2c8974bb260010c284bf9ffa959ece6f49032620#diff-fe959fb34f64335a7bd04ae7a5b70bbc18da8681cf0b42d67a5a714eb5f86b35
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.