René's URL Explorer Experiment


Title: gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` by AlexWaygood · Pull Request #118202 · python/cpython · GitHub

Open Graph Title: gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` by AlexWaygood · Pull Request #118202 · python/cpython

X Title: gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` by AlexWaygood · Pull Request #118202 · python/cpython

Description: Slower than main, but significantly faster than a straight revert of #104267. Issue: [3.12] getattr_static can result in reference leaks #118013

Open Graph Description: Slower than main, but significantly faster than a straight revert of #104267. Issue: [3.12] getattr_static can result in reference leaks #118013

X Description: Slower than main, but significantly faster than a straight revert of #104267. Issue: [3.12] getattr_static can result in reference leaks #118013

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

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:2716e284-9ae5-1978-2e8c-39caea7956a9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCDB4:2171D7:E2297B:13BCE31:696A3B27
html-safe-noncecd38e0f3eb21993c8972a0b21769fe649f6bcd48240df395546225655a4a932c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREI0OjIxNzFENzpFMjI5N0I6MTNCQ0UzMTo2OTZBM0IyNyIsInZpc2l0b3JfaWQiOiIyMjkwNzA0NjQyODMzMjY3NDk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8d2c641b67b4994c27c402694d893a93a8a95ec3866e7e60628a2ae25866df25
hovercard-subject-tagpull_request:1837634743
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///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/118202/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/84cb929114bdadbc66f323d7104756e1d56b01401c6bdf082ed0eeae4061b6fa/python/cpython/pull/118202
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/84cb929114bdadbc66f323d7104756e1d56b01401c6bdf082ed0eeae4061b6fa/python/cpython/pull/118202
og:image:altSlower than main, but significantly faster than a straight revert of #104267. Issue: [3.12] getattr_static can result in reference leaks #118013
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlexWaygood
hostnamegithub.com
expected-hostnamegithub.com
None321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538
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
release13581a31d51edf4a3aca179e10890a4d4f9b6d76
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/118202#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F118202
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%2F118202
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%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/118202
Reloadhttps://github.com/python/cpython/pull/118202
Reloadhttps://github.com/python/cpython/pull/118202
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/118202
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/118202
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
Jump to bottomhttps://github.com/python/cpython/pull/118202#issue-comment-box
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
AlexWaygood:inspect-weakref-cache-keyhttps://github.com/AlexWaygood/cpython/tree/inspect-weakref-cache-key
gh-118013: Use weakrefs for the cache key in inspect._shadowed_dict https://github.com/python/cpython/pull/118202#top
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
AlexWaygood:inspect-weakref-cache-keyhttps://github.com/AlexWaygood/cpython/tree/inspect-weakref-cache-key
Conversation 14 https://github.com/python/cpython/pull/118202
Commits 9 https://github.com/python/cpython/pull/118202/commits
Checks 0 https://github.com/python/cpython/pull/118202/checks
Files changed https://github.com/python/cpython/pull/118202/files
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Apr 23, 2024https://github.com/python/cpython/pull/118202#issue-2259924600
Please reload this pagehttps://github.com/python/cpython/pull/118202
#104267https://github.com/python/cpython/pull/104267
[3.12] getattr_static can result in reference leaks #118013https://github.com/python/cpython/issues/118013
Please reload this pagehttps://github.com/python/cpython/pull/118202
AlexWaygoodhttps://github.com/AlexWaygood
April 23, 2024 23:36https://github.com/python/cpython/pull/118202#commits-pushed-c314217
https://github.com/AlexWaygood
wiphttps://github.com/python/cpython/pull/118202/commits/c314217f90ce5ba586b815cf9a4a7b4c82d31896
c314217https://github.com/python/cpython/pull/118202/commits/c314217f90ce5ba586b815cf9a4a7b4c82d31896
https://github.com/AlexWaygood
wiphttps://github.com/python/cpython/pull/118202/commits/e4b29893e611f0bd2b36dadcc5ce808e76d61d34
e4b2989https://github.com/python/cpython/pull/118202/commits/e4b29893e611f0bd2b36dadcc5ce808e76d61d34
https://github.com/AlexWaygood
wiphttps://github.com/python/cpython/pull/118202/commits/57da345a8d904705e82b141ef8a69f28cf60c634
57da345https://github.com/python/cpython/pull/118202/commits/57da345a8d904705e82b141ef8a69f28cf60c634
https://github.com/AlexWaygood
wiphttps://github.com/python/cpython/pull/118202/commits/4df5d081be32e718a7fc72614ef8d16141a1fb0b
4df5d08https://github.com/python/cpython/pull/118202/commits/4df5d081be32e718a7fc72614ef8d16141a1fb0b
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Apr 23, 2024 https://github.com/python/cpython/pull/118202#ref-issue-2249342935
[3.12] getattr_static can result in reference leaks #118013 https://github.com/python/cpython/issues/118013
https://github.com/AlexWaygood
Merge branch 'main' into inspect-weakref-cache-keyhttps://github.com/python/cpython/pull/118202/commits/fd9b22b0c6c6e68a5b63afe6656140d376599c1b
fd9b22bhttps://github.com/python/cpython/pull/118202/commits/fd9b22b0c6c6e68a5b63afe6656140d376599c1b
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
carljmhttps://github.com/carljm
April 23, 2024 23:12https://github.com/python/cpython/pull/118202#event-12582750708
https://github.com/carljm
carljmhttps://github.com/carljm
Apr 24, 2024 https://github.com/python/cpython/pull/118202#pullrequestreview-2018821410
View reviewed changes https://github.com/python/cpython/pull/118202/files/fd9b22b0c6c6e68a5b63afe6656140d376599c1b
carljmhttps://github.com/carljm
https://github.com/python/cpython/pull/118202#pullrequestreview-2018821410
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/118202
Lib/inspect.pyhttps://github.com/python/cpython/pull/118202/files/fd9b22b0c6c6e68a5b63afe6656140d376599c1b#diff-b89cd06e4637abacb73f2500301ff979a67ad7ecbfa7cf151c7243715898d7ea
Please reload this pagehttps://github.com/python/cpython/pull/118202
AlexWaygoodhttps://github.com/AlexWaygood
April 24, 2024 12:07https://github.com/python/cpython/pull/118202#commits-pushed-5847027
https://github.com/AlexWaygood
Tests and commentshttps://github.com/python/cpython/pull/118202/commits/5847027b18817905987ba3ab807d30be4ab4feb5
5847027https://github.com/python/cpython/pull/118202/commits/5847027b18817905987ba3ab807d30be4ab4feb5
https://github.com/AlexWaygood
Clear the cache anyway after running test_inspect, for extra safetyhttps://github.com/python/cpython/pull/118202/commits/677577e07067e49ed03e61225ab98ea2c53bb9cd
677577ehttps://github.com/python/cpython/pull/118202/commits/677577e07067e49ed03e61225ab98ea2c53bb9cd
https://github.com/AlexWaygood
docshttps://github.com/python/cpython/pull/118202/commits/6891c70cebf41b77300a6814adb9976305a9acf2
6891c70https://github.com/python/cpython/pull/118202/commits/6891c70cebf41b77300a6814adb9976305a9acf2
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
April 24, 2024 11:23https://github.com/python/cpython/pull/118202#event-12590300803
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12590301372
https://github.com/AlexWaygood
Merge branch 'main' into inspect-weakref-cache-keyhttps://github.com/python/cpython/pull/118202/commits/4791b4be82a2b67c8f016af32c42072e6c84f207
4791b4bhttps://github.com/python/cpython/pull/118202/commits/4791b4be82a2b67c8f016af32c42072e6c84f207
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Apr 24, 2024https://github.com/python/cpython/pull/118202#issuecomment-2074743989
#104267https://github.com/python/cpython/pull/104267
#104267https://github.com/python/cpython/pull/104267
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
carljmhttps://github.com/carljm
April 24, 2024 11:39https://github.com/python/cpython/pull/118202#event-12590501818
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
needs backport to 3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.12%22
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12590548030
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Apr 24, 2024https://github.com/python/cpython/pull/118202#issuecomment-2074753441
@sobolevnhttps://github.com/sobolevn
#103193 (comment)https://github.com/python/cpython/issues/103193#issuecomment-1497396338
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Apr 24, 2024 https://github.com/python/cpython/pull/118202#pullrequestreview-2019667756
View reviewed changes https://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207
Lib/inspect.pyhttps://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207#diff-b89cd06e4637abacb73f2500301ff979a67ad7ecbfa7cf151c7243715898d7ea
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/carljm
carljmhttps://github.com/carljm
Apr 24, 2024 https://github.com/python/cpython/pull/118202#pullrequestreview-2020096015
View reviewed changes https://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207
carljmhttps://github.com/carljm
https://github.com/python/cpython/pull/118202#pullrequestreview-2020096015
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/118202
Lib/test/test_inspect/test_inspect.pyhttps://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12593358203
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
8227883https://github.com/python/cpython/commit/8227883d1f1bbb6560e5f175d7ee49f013c094bd
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12593441367
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
April 24, 2024 14:55https://github.com/python/cpython/pull/118202#event-12593441650
https://github.com/apps/miss-islington-app
miss-islington-apphttps://github.com/apps/miss-islington-app
Apr 24, 2024https://github.com/python/cpython/pull/118202#issuecomment-2075146641
@AlexWaygoodhttps://github.com/AlexWaygood
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12593442211
miss-islingtonhttps://github.com/miss-islington
Apr 24, 2024 https://github.com/python/cpython/pull/118202#ref-commit-fa9d669
https://github.com/AlexWaygood
https://github.com/miss-islington
pythongh-118013https://github.com/python/cpython/issues/118013
: Use weakrefs for the cache key in `inspect._shadowed…https://github.com/miss-islington/cpython/commit/fa9d6691da14a9049056061d2ffece4545bdd3cc
fa9d669https://github.com/miss-islington/cpython/commit/fa9d6691da14a9049056061d2ffece4545bdd3cc
pythonGH-118202https://github.com/python/cpython/pull/118202
8227883https://github.com/miss-islington/cpython/commit/8227883d1f1bbb6560e5f175d7ee49f013c094bd
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Apr 24, 2024https://github.com/python/cpython/pull/118202#issuecomment-2075147324
GH-118232https://github.com/python/cpython/pull/118232
3.12 branchhttps://github.com/python/cpython/tree/3.12
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
needs backport to 3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.12%22
Apr 24, 2024https://github.com/python/cpython/pull/118202#event-12593446338
AlexWaygoodhttps://github.com/AlexWaygood
Apr 24, 2024 https://github.com/python/cpython/pull/118202#ref-commit-0691bd8
https://github.com/miss-islington
https://github.com/AlexWaygood
[3.12]https://github.com/python/cpython/commit/0691bd860d3de0c1feb1566d99315a0a582c62a0
gh-118013https://github.com/python/cpython/issues/118013
: Use weakrefs for the cache key in `inspect._shadowe…https://github.com/python/cpython/commit/0691bd860d3de0c1feb1566d99315a0a582c62a0
0691bd8https://github.com/python/cpython/commit/0691bd860d3de0c1feb1566d99315a0a582c62a0
GH-118202https://github.com/python/cpython/pull/118202
#118232https://github.com/python/cpython/pull/118232
https://github.com/eendebakpt
eendebakpthttps://github.com/eendebakpt
Apr 30, 2025 https://github.com/python/cpython/pull/118202#ref-issue-3018495007
Understand the outlier benchmarks on 3.14 (main) vs. 3.13.0 faster-cpython/ideas#726 https://github.com/faster-cpython/ideas/issues/726
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F118202
https://github.com/sobolevn
sobolevn https://github.com/sobolevn
https://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207
https://github.com/carljm
carljm https://github.com/carljm
https://github.com/python/cpython/pull/118202/files/4791b4be82a2b67c8f016af32c42072e6c84f207
Please reload this pagehttps://github.com/python/cpython/pull/118202
https://github.com/AlexWaygood
https://github.com/carljm
https://github.com/sobolevn
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.