René's URL Explorer Experiment


Title: gh-148587: Make `sys.lazy_modules` immutable by johnslavik · Pull Request #149408 · python/cpython · GitHub

Open Graph Title: gh-148587: Make `sys.lazy_modules` immutable by johnslavik · Pull Request #149408 · python/cpython

X Title: gh-148587: Make `sys.lazy_modules` immutable by johnslavik · Pull Request #149408 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: Feel free to chime in with criticism. I'm not sure this is it yet, but take it in your own hands if you want. Issue: Revamp sys.lazy_modules #148587

X Description: Feel free to chime in with criticism. I'm not sure this is it yet, but take it in your own hands if you want. Issue: Revamp sys.lazy_modules #148587

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

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:d39890c0-f0d1-680a-8095-ab99dbaf4036
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id856C:4EC07:1C0525:27FBCF:6A560424
html-safe-nonceed955a32b1f1469513a5886dc018bcb974f1d2e77a233ead434f4a9345539382
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTZDOjRFQzA3OjFDMDUyNToyN0ZCQ0Y6NkE1NjA0MjQiLCJ2aXNpdG9yX2lkIjoiNDAyMjUxNjY0ODY1NzY4MzQ5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfe6cd53d8b62e9ca3ac88cfe0413d89f5a93bdbabc2d70bb2694d22b2f18c0ca
hovercard-subject-tagpull_request:3630141928
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/149408/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/afaac267e6b79903757020fe5694d05439ef4048994cd15b401361c5fb63bd97/python/cpython/pull/149408
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/afaac267e6b79903757020fe5694d05439ef4048994cd15b401361c5fb63bd97/python/cpython/pull/149408
og:image:altFeel free to chime in with criticism. I'm not sure this is it yet, but take it in your own hands if you want. Issue: Revamp sys.lazy_modules #148587
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejohnslavik
hostnamegithub.com
expected-hostnamegithub.com
Nonef4368738fc918fecd9b3958f6b49218bbe60d4185f38e72e3954e11f1ad0213a
turbo-cache-controlno-cache
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
releaseed27e29ef37c0e8f612ea3fed8118b955b8314e2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/149408#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F149408
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F149408
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/149408
Reloadhttps://github.com/python/cpython/pull/149408
Reloadhttps://github.com/python/cpython/pull/149408
Please reload this pagehttps://github.com/python/cpython/pull/149408
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/149408
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
johnslavikhttps://github.com/johnslavik
python:mainhttps://github.com/python/cpython/tree/main
johnslavik:gh-148587-revamp-sys-lazy-moduleshttps://github.com/johnslavik/cpython/tree/gh-148587-revamp-sys-lazy-modules
Conversationhttps://github.com/python/cpython/pull/149408
Commits14 (14)https://github.com/python/cpython/pull/149408/commits
Checkshttps://github.com/python/cpython/pull/149408/checks
Files changedhttps://github.com/python/cpython/pull/149408/files
gh-148587: Make sys.lazy_modules immutablehttps://github.com/python/cpython/pull/149408#top
johnslavikhttps://github.com/johnslavik
python:mainhttps://github.com/python/cpython/tree/main
johnslavik:gh-148587-revamp-sys-lazy-moduleshttps://github.com/johnslavik/cpython/tree/gh-148587-revamp-sys-lazy-modules
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
May 5, 2026https://github.com/python/cpython/pull/149408#issue-4383712087
Please reload this pagehttps://github.com/python/cpython/pull/149408
Revamp sys.lazy_modules #148587https://github.com/python/cpython/issues/148587
Please reload this pagehttps://github.com/python/cpython/pull/149408
johnslavikhttps://github.com/johnslavik
April 26, 2026 23:43https://github.com/python/cpython/pull/149408#commits-pushed-351473b
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Make sys.lazy_modules an immutable frozendict snapshothttps://github.com/python/cpython/pull/149408/commits/351473b6a188a71acd0524b00f19bb2577e6b1c1
351473bhttps://github.com/python/cpython/pull/149408/commits/351473b6a188a71acd0524b00f19bb2577e6b1c1
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Expose live lazy import registry as sys._lazy_moduleshttps://github.com/python/cpython/pull/149408/commits/083bbe99cf66881ca407bdf5e81b4f4c569e2521
083bbe9https://github.com/python/cpython/pull/149408/commits/083bbe99cf66881ca407bdf5e81b4f4c569e2521
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Address review feedback on sys.lazy_moduleshttps://github.com/python/cpython/pull/149408/commits/eac60ede1e87f8eab8008a2a79a1e7e00a256bfb
eac60edhttps://github.com/python/cpython/pull/149408/commits/eac60ede1e87f8eab8008a2a79a1e7e00a256bfb
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Trim sys.lazy_modules contract test and NEWShttps://github.com/python/cpython/pull/149408/commits/0424a64806a0eb2c2ed31a85d7faf204dd4c6401
0424a64https://github.com/python/cpython/pull/149408/commits/0424a64806a0eb2c2ed31a85d7faf204dd4c6401
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Align sys.__getattr__ with _ctypes/zlib patternhttps://github.com/python/cpython/pull/149408/commits/44049725abc3360b01a42f391dad5161ef317312
4404972https://github.com/python/cpython/pull/149408/commits/44049725abc3360b01a42f391dad5161ef317312
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Use METH_VARARGS for sys.__getattr__https://github.com/python/cpython/pull/149408/commits/f4f8fb2a47c07af69f7d8c724e55cb7a741c0f1a
f4f8fb2https://github.com/python/cpython/pull/149408/commits/f4f8fb2a47c07af69f7d8c724e55cb7a741c0f1a
https://github.com/johnslavik
pythongh-148587https://github.com/python/cpython/issues/148587
: Pre-size and short-circuit empty in lazy modules sna…https://github.com/python/cpython/pull/149408/commits/a94f4e7a6672819948c173088688b17859ccf127
a94f4e7https://github.com/python/cpython/pull/149408/commits/a94f4e7a6672819948c173088688b17859ccf127
https://github.com/johnslavik
Revert pre-size and empty fast path in lazy modules snapshothttps://github.com/python/cpython/pull/149408/commits/926a02eecdd6e9a8d2c7d92641e3a02fbe738121
926a02ehttps://github.com/python/cpython/pull/149408/commits/926a02eecdd6e9a8d2c7d92641e3a02fbe738121
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
DinoVhttps://github.com/DinoV
FFY00https://github.com/FFY00
Yhg1shttps://github.com/Yhg1s
brettcannonhttps://github.com/brettcannon
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
kumaraditya303https://github.com/kumaraditya303
ncoghlanhttps://github.com/ncoghlan
pablogsalhttps://github.com/pablogsal
warsawhttps://github.com/warsaw
code ownershttps://github.com/python/cpython/blob/f6d16a0d708c611dd96bb739f0896a0b6d7e04e8/.github/CODEOWNERS#L303
May 5, 2026 11:37https://github.com/python/cpython/pull/149408#event-25173770534
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
May 5, 2026 https://github.com/python/cpython/pull/149408#ref-issue-4265366089
Revamp sys.lazy_modules #148587 https://github.com/python/cpython/issues/148587
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
May 5, 2026https://github.com/python/cpython/pull/149408#event-25173774520
https://github.com/apps/read-the-docs-community
read-the-docs-communityhttps://github.com/apps/read-the-docs-community
May 5, 2026https://github.com/python/cpython/pull/149408#issuecomment-4378899239
Please reload this pagehttps://github.com/python/cpython/pull/149408
cpython-previewshttps://app.readthedocs.org/projects/cpython-previews/
#32726871https://app.readthedocs.org/projects/cpython-previews/builds/32726871/
e4bbea8https://github.com/python/cpython/commit/e4bbea82f46adf4ac426c1f400bfb45f948a15f4
mainhttps://cpython-previews.readthedocs.io/en/main/
f6d16a0https://github.com/python/cpython/commit/f6d16a0d708c611dd96bb739f0896a0b6d7e04e8
  🔍 Preview build   https://cpython-previews--149408.org.readthedocs.build/en/149408/
glossary.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/glossary.html
c-api/concrete.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/concrete.html
c-api/extension-modules.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/extension-modules.html
c-api/index.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/index.html
c-api/lifecycle.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/lifecycle.html
c-api/module.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/module.html
c-api/perfmaps.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/perfmaps.html
c-api/stable.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/stable.html
c-api/synchronization.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/synchronization.html
c-api/type.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/type.html
c-api/sentinel.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/sentinel.html
c-api/slots.htmlhttps://cpython-previews--149408.org.readthedocs.build/en/149408/c-api/slots.html
Please reload this pagehttps://github.com/python/cpython/pull/149408
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
May 5, 2026 12:03https://github.com/python/cpython/pull/149408#event-25174660870
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
May 5, 2026https://github.com/python/cpython/pull/149408#event-25174662553
johnslavikhttps://github.com/johnslavik
May 5, 2026 14:13https://github.com/python/cpython/pull/149408#commits-pushed-ca32d07
https://github.com/johnslavik
Add docstring to sys.__getattr__https://github.com/python/cpython/pull/149408/commits/ca32d07bedc36ebb269f473fff119ce0cd34937b
ca32d07https://github.com/python/cpython/pull/149408/commits/ca32d07bedc36ebb269f473fff119ce0cd34937b
https://github.com/johnslavik
Add sys.__dir__ so lazy_modules appears in tab completionhttps://github.com/python/cpython/pull/149408/commits/3dff9ef08fa8da73080233945f573e8951e36ed9
3dff9efhttps://github.com/python/cpython/pull/149408/commits/3dff9ef08fa8da73080233945f573e8951e36ed9
https://github.com/johnslavik
Fix METH_NOARGS signature and wrap long line in sys_dir/sys_getattrhttps://github.com/python/cpython/pull/149408/commits/2c0e3f2d8e89c28c7334d7ed493ec841cc55a4e1
2c0e3f2https://github.com/python/cpython/pull/149408/commits/2c0e3f2d8e89c28c7334d7ed493ec841cc55a4e1
https://github.com/johnslavik
Add sys.lazy_modules docs and fix CI test failureshttps://github.com/python/cpython/pull/149408/commits/17de69ef42653eb42c32f82f818affa1f6bda1cd
17de69ehttps://github.com/python/cpython/pull/149408/commits/17de69ef42653eb42c32f82f818affa1f6bda1cd
https://github.com/johnslavik
Remove internal _lazy_modules mention and bogus set_lazy_imports cros…https://github.com/python/cpython/pull/149408/commits/46c6033a5eb6efb6944671a9fe6f759685ecac7c
46c6033https://github.com/python/cpython/pull/149408/commits/46c6033a5eb6efb6944671a9fe6f759685ecac7c
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
topic-lazy-imports https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-lazy-imports
May 6, 2026https://github.com/python/cpython/pull/149408#event-25212763947
https://github.com/brettcannon
brettcannonhttps://github.com/brettcannon
May 6, 2026 20:49https://github.com/python/cpython/pull/149408#event-25235737947
https://github.com/johnslavik
Fix test_sys_module_has_signatures: METH_NOARGS never has None text s…https://github.com/python/cpython/pull/149408/commits/e4bbea82f46adf4ac426c1f400bfb45f948a15f4
e4bbea8https://github.com/python/cpython/pull/149408/commits/e4bbea82f46adf4ac426c1f400bfb45f948a15f4
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
May 19, 2026https://github.com/python/cpython/pull/149408#issuecomment-4488318973
#150014https://github.com/python/cpython/pull/150014
Please reload this pagehttps://github.com/python/cpython/pull/149408
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
May 19, 2026https://github.com/python/cpython/pull/149408#event-25708281937
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
May 19, 2026 13:39https://github.com/python/cpython/pull/149408#event-25708286559
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
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%2F149408
https://github.com/Yhg1s
Yhg1s https://github.com/Yhg1s
https://github.com/DinoV
DinoV https://github.com/DinoV
https://github.com/pablogsal
pablogsal https://github.com/pablogsal
https://github.com/ericsnowcurrently
ericsnowcurrently https://github.com/ericsnowcurrently
https://github.com/ncoghlan
ncoghlan https://github.com/ncoghlan
https://github.com/warsaw
warsaw https://github.com/warsaw
https://github.com/FFY00
FFY00 https://github.com/FFY00
https://github.com/kumaraditya303
kumaraditya303 https://github.com/kumaraditya303
https://github.com/brettcannon
brettcannon https://github.com/brettcannon
topic-lazy-imports https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-lazy-imports
Please reload this pagehttps://github.com/python/cpython/pull/149408
https://github.com/johnslavik
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.