René's URL Explorer Experiment


Title: [MNT]: Lazy imports in python 3.15+ · Issue #30933 · matplotlib/matplotlib · GitHub

Open Graph Title: [MNT]: Lazy imports in python 3.15+ · Issue #30933 · matplotlib/matplotlib

X Title: [MNT]: Lazy imports in python 3.15+ · Issue #30933 · matplotlib/matplotlib

Description: A ways off, but creating this tracking issue to collect ideas as they arise. Python 3.15 (October 2026) will introduce PEP 810 - Explicit lazy imports. This has the potential to significantly improve startup time performance - as one exa...

Open Graph Description: A ways off, but creating this tracking issue to collect ideas as they arise. Python 3.15 (October 2026) will introduce PEP 810 - Explicit lazy imports. This has the potential to significantly impro...

X Description: A ways off, but creating this tracking issue to collect ideas as they arise. Python 3.15 (October 2026) will introduce PEP 810 - Explicit lazy imports. This has the potential to significantly impro...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30933

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Lazy imports in python 3.15+","articleBody":"A ways off, but creating this tracking issue to collect ideas as they arise.\n\nPython 3.15 (October 2026) will introduce [PEP 810 - Explicit lazy imports](https://peps.python.org/pep-0810). This has the potential to significantly improve startup time performance - as one example Meta reports 70% reduction in initialization time by converting its libraries to use lazy imports ([link](https://developers.facebook.com/blog/post/2022/06/15/python-lazy-imports-with-cinder/)). I expect the performance increase here to compound as our dependencies roll in lazy import support as well. With how widely used matplotlib is, I expect people to start asking for this before too long.\n\nFor backwards compatibility, we will need to use the `__lazy_modules__` approach rather than the `lazy` import syntax:\n\n```python\n__lazy_modules__ = [\"json\", \"collections.abc\"]\n\nimport requests  # eager, since not in list\nimport json  # lazy\nfrom json import dumps, loads  # lazy, each name is a lazy proxy\nfrom collections.abc import Mapping  # lazy\nfrom numpy import *  # eager, but we should move away from star imports\n```\n\nSome things may currently rely on eager import-time execution (global state, ImportError checks, backend/plugin registration (?), etc). Anything relying on eager execution can be left out of the `__lazy_modules__` list and fixed at a later time.\n\nThere are a few existing issues talking about deferred imports, which I believe will be subsumed by this. We can talk about whether it's worth putting effort into those anyways for older python versions: https://github.com/matplotlib/matplotlib/issues/22247, (maybe) https://github.com/matplotlib/matplotlib/issues/30578.\n\nRough plan:\n\n- [ ] Benchmark existing startup time (should measure both `import matplotlib` and `import matplotlib.pyplot as plt`)\n- [ ] Audit code for anything relying on eager import-time execution\n- [ ] Audit code for deferred imports which can be brought up to top-level\n- [ ] Audit code for star imports\n- [ ] Any code relying on a particular import _order_ should be fixed\n- [ ] Move imports over to `__lazy_modules__` (excluding things relying on eager imports)\n- [ ] Benchmark new startup time\n- [ ] Add CI test coverage for all-eager and all-lazy import cases to catch breakage: `python -X lazy_imports=none -m pytest` `python -X lazy_imports=all -m pytest`\n\nAlternatively this could be an incremental roll-in, focusing on the heavier weight modules.","author":{"url":"https://github.com/scottshambaugh","@type":"Person","name":"scottshambaugh"},"datePublished":"2026-01-04T17:30:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/30933/matplotlib/issues/30933"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d557f5fc-e15d-240f-d778-faf423b53c72
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8962:FE603:37958F6:49506D3:696BA9C3
html-safe-nonce3751e02e1b8dccccdaa49676c4e855c2793b2df06f7309dbd4185469434d417a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTYyOkZFNjAzOjM3OTU4RjY6NDk1MDZEMzo2OTZCQTlDMyIsInZpc2l0b3JfaWQiOiIxNDI1MjQ0MjU5OTY1NzA4NzM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaccb4df9de5483e22c1638d44ceab369752da32ecdb0cd10495ceea45bcc0cfff1
hovercard-subject-tagissue:3779465387
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/30933/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ee5424c1375c82f7e94cbbe615be4ccea3f9dacb3db17b0b5130f978096ddd22/matplotlib/matplotlib/issues/30933
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ee5424c1375c82f7e94cbbe615be4ccea3f9dacb3db17b0b5130f978096ddd22/matplotlib/matplotlib/issues/30933
og:image:altA ways off, but creating this tracking issue to collect ideas as they arise. Python 3.15 (October 2026) will introduce PEP 810 - Explicit lazy imports. This has the potential to significantly impro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamescottshambaugh
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F30933
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F30933
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933
Reloadhttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933
Reloadhttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933
matplotlib https://patch-diff.githubusercontent.com/matplotlib
matplotlibhttps://patch-diff.githubusercontent.com/matplotlib/matplotlib
Please reload this pagehttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 22.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://patch-diff.githubusercontent.com/matplotlib/matplotlib
Issues 1.1k https://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues
Pull requests 403 https://patch-diff.githubusercontent.com/matplotlib/matplotlib/pulls
Actions https://patch-diff.githubusercontent.com/matplotlib/matplotlib/actions
Projects 2 https://patch-diff.githubusercontent.com/matplotlib/matplotlib/projects
Wiki https://patch-diff.githubusercontent.com/matplotlib/matplotlib/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/matplotlib/matplotlib/security
Please reload this pagehttps://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933
Insights https://patch-diff.githubusercontent.com/matplotlib/matplotlib/pulse
Code https://patch-diff.githubusercontent.com/matplotlib/matplotlib
Issues https://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues
Pull requests https://patch-diff.githubusercontent.com/matplotlib/matplotlib/pulls
Actions https://patch-diff.githubusercontent.com/matplotlib/matplotlib/actions
Projects https://patch-diff.githubusercontent.com/matplotlib/matplotlib/projects
Wiki https://patch-diff.githubusercontent.com/matplotlib/matplotlib/wiki
Security https://patch-diff.githubusercontent.com/matplotlib/matplotlib/security
Insights https://patch-diff.githubusercontent.com/matplotlib/matplotlib/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/30933
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/30933
[MNT]: Lazy imports in python 3.15+https://patch-diff.githubusercontent.com/matplotlib/matplotlib/issues/30933#top
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%22
Performancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Performance%22
https://github.com/scottshambaugh
https://github.com/scottshambaugh
scottshambaughhttps://github.com/scottshambaugh
on Jan 4, 2026https://github.com/matplotlib/matplotlib/issues/30933#issue-3779465387
PEP 810 - Explicit lazy importshttps://peps.python.org/pep-0810
linkhttps://developers.facebook.com/blog/post/2022/06/15/python-lazy-imports-with-cinder/
#22247https://github.com/matplotlib/matplotlib/issues/22247
#30578https://github.com/matplotlib/matplotlib/issues/30578
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%22
Performancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Performance%22
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.