| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:00750465-6cab-250a-dda0-b3f539244214 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A65C:2BB8A0:B91B06:10CDB8F:6A562308 |
| html-safe-nonce | b1715bf739e431f26776409ee9259349186ddec19bda26196ea04e9fbbed8466 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjVDOjJCQjhBMDpCOTFCMDY6MTBDREI4Rjo2QTU2MjMwOCIsInZpc2l0b3JfaWQiOiI1ODY1OTcwMzk3OTc2MzM5MjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3cf34ade3ae75d418e7326bbd3df30352e416a9259866bc71b31921bd8c65f82 |
| hovercard-subject-tag | pull_request:3630141928 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/149408/files |
| twitter:image | https://avatars.githubusercontent.com/u/64036239?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/64036239?s=400&v=4 |
| og:image:alt | 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: gh-148587 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | eeb71977be324ce2bc7c4afd597296b8e3527d8922ad94632edd7a7296f8031b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3e7957744c8a44d05ff1e464dc5d119e60b98fae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/cpython/pull/149408/files#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F149408%2Ffiles |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub Copilot appDirect agents from issue to merge | https://github.com/features/ai/github-app |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| View all resources | https://github.com/resources |
| GitHub SponsorsFund open source developers | https://github.com/open-source/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/open-source/accelerator |
| GitHub Stars | https://stars.github.com |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://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%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 |
| Reload | https://github.com/python/cpython/pull/149408/files |
| Reload | https://github.com/python/cpython/pull/149408/files |
| Reload | https://github.com/python/cpython/pull/149408/files |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
|
python
| https://github.com/python |
| cpython | https://github.com/python/cpython |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
|
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 |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| johnslavik | https://github.com/johnslavik |
| python:main | https://github.com/python/cpython/tree/main |
| johnslavik:gh-148587-revamp-sys-lazy-modules | https://github.com/johnslavik/cpython/tree/gh-148587-revamp-sys-lazy-modules |
|
Conversation
2
| https://github.com/python/cpython/pull/149408 |
|
Commits
14
| https://github.com/python/cpython/pull/149408/commits |
|
Checks
51
| https://github.com/python/cpython/pull/149408/checks |
|
Files changed
| https://github.com/python/cpython/pull/149408/files |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
|
gh-148587: Make sys.lazy_modules immutable
| https://github.com/python/cpython/pull/149408/files#top |
|
Show all changes
14 commits
| https://github.com/python/cpython/pull/149408/files |
|
351473b
gh-148587: Make sys.lazy_modules an immutable frozendict snapshot
johnslavik Apr 26, 2026
| https://github.com/python/cpython/pull/149408/commits/351473b6a188a71acd0524b00f19bb2577e6b1c1 |
|
083bbe9
gh-148587: Expose live lazy import registry as sys._lazy_modules
johnslavik May 4, 2026
| https://github.com/python/cpython/pull/149408/commits/083bbe99cf66881ca407bdf5e81b4f4c569e2521 |
|
eac60ed
gh-148587: Address review feedback on sys.lazy_modules
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/eac60ede1e87f8eab8008a2a79a1e7e00a256bfb |
|
0424a64
gh-148587: Trim sys.lazy_modules contract test and NEWS
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/0424a64806a0eb2c2ed31a85d7faf204dd4c6401 |
|
4404972
gh-148587: Align sys.__getattr__ with _ctypes/zlib pattern
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/44049725abc3360b01a42f391dad5161ef317312 |
|
f4f8fb2
gh-148587: Use METH_VARARGS for sys.__getattr__
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/f4f8fb2a47c07af69f7d8c724e55cb7a741c0f1a |
|
a94f4e7
gh-148587: Pre-size and short-circuit empty in lazy modules snapshot
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/a94f4e7a6672819948c173088688b17859ccf127 |
|
926a02e
Revert pre-size and empty fast path in lazy modules snapshot
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/926a02eecdd6e9a8d2c7d92641e3a02fbe738121 |
|
ca32d07
Add docstring to sys.__getattr__
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/ca32d07bedc36ebb269f473fff119ce0cd34937b |
|
3dff9ef
Add sys.__dir__ so lazy_modules appears in tab completion
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/3dff9ef08fa8da73080233945f573e8951e36ed9 |
|
2c0e3f2
Fix METH_NOARGS signature and wrap long line in sys_dir/sys_getattr
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/2c0e3f2d8e89c28c7334d7ed493ec841cc55a4e1 |
|
17de69e
Add sys.lazy_modules docs and fix CI test failures
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/17de69ef42653eb42c32f82f818affa1f6bda1cd |
|
46c6033
Remove internal _lazy_modules mention and bogus set_lazy_imports cros…
johnslavik May 5, 2026
| https://github.com/python/cpython/pull/149408/commits/46c6033a5eb6efb6944671a9fe6f759685ecac7c |
|
e4bbea8
Fix test_sys_module_has_signatures: METH_NOARGS never has None text s…
johnslavik May 17, 2026
| https://github.com/python/cpython/pull/149408/commits/e4bbea82f46adf4ac426c1f400bfb45f948a15f4 |
|
Clear filters
| https://github.com/python/cpython/pull/149408/files |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
|
sys.rst
| https://github.com/python/cpython/pull/149408/files#diff-26fe9050845b6be0f74760ffe9095874cfe2dfec55c22b18e7dba58f3978a418 |
|
pycore_import.h
| https://github.com/python/cpython/pull/149408/files#diff-f0d0635a621a67c4105f6b306ecabc7b6f8e1fe1518ae49baf006c26f71520b5 |
|
test_builtin.py
| https://github.com/python/cpython/pull/149408/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b |
|
test_inspect.py
| https://github.com/python/cpython/pull/149408/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0 |
|
__init__.py
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
2026-04-26-20-44-58.gh-issue-148587.f791BR.rst
| https://github.com/python/cpython/pull/149408/files#diff-fc8da8e4e240abbfdd86b52af6fde9aad9dccced6113cba2b7c162bc7d490419 |
|
import.c
| https://github.com/python/cpython/pull/149408/files#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3 |
|
sysmodule.c
| https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
| Doc/library/sys.rst | https://github.com/python/cpython/pull/149408/files#diff-26fe9050845b6be0f74760ffe9095874cfe2dfec55c22b18e7dba58f3978a418 |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Doc/library/sys.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-26fe9050845b6be0f74760ffe9095874cfe2dfec55c22b18e7dba58f3978a418 |
|
| https://github.com/python/cpython/pull/149408/files#diff-26fe9050845b6be0f74760ffe9095874cfe2dfec55c22b18e7dba58f3978a418 |
|
| https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L264 |
| Include/internal/pycore_import.h | https://github.com/python/cpython/pull/149408/files#diff-f0d0635a621a67c4105f6b306ecabc7b6f8e1fe1518ae49baf006c26f71520b5 |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Include/internal/pycore_import.h |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-f0d0635a621a67c4105f6b306ecabc7b6f8e1fe1518ae49baf006c26f71520b5 |
|
| https://github.com/python/cpython/pull/149408/files#diff-f0d0635a621a67c4105f6b306ecabc7b6f8e1fe1518ae49baf006c26f71520b5 |
| Lib/test/test_builtin.py | https://github.com/python/cpython/pull/149408/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Lib/test/test_builtin.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b |
|
| https://github.com/python/cpython/pull/149408/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b |
| Lib/test/test_inspect/test_inspect.py | https://github.com/python/cpython/pull/149408/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0 |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Lib/test/test_inspect/test_inspect.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0 |
|
| https://github.com/python/cpython/pull/149408/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0 |
|
| https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L302 |
| Lib/test/test_lazy_import/__init__.py | https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Lib/test/test_lazy_import/__init__.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
|
| https://github.com/python/cpython/pull/149408/files#diff-9c7ed57cb280bfcf280bf31daf9747c91ca26b50196a9f84c1a38f105d83b31e |
| Misc/NEWS.d/next/Core_and_Builtins/2026-04-26-20-44-58.gh-issue-148587.f791BR.rst | https://github.com/python/cpython/pull/149408/files#diff-fc8da8e4e240abbfdd86b52af6fde9aad9dccced6113cba2b7c162bc7d490419 |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Misc/NEWS.d/next/Core_and_Builtins/2026-04-26-20-44-58.gh-issue-148587.f791BR.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L265 |
| Python/import.c | https://github.com/python/cpython/pull/149408/files#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3 |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Python/import.c |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3 |
|
| https://github.com/python/cpython/pull/149408/files#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3 |
|
| https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L247 |
| Python/sysmodule.c | https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
|
View file
| https://github.com/johnslavik/cpython/blob/e4bbea82f46adf4ac426c1f400bfb45f948a15f4/Python/sysmodule.c |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/149408/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
|
| https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
|
| https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
|
| https://github.com/python/cpython/pull/149408/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb |
| Please reload this page | https://github.com/python/cpython/pull/149408/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |