The Story of Python's Lazy Imports: Why It Took Three Years and Two Attempts
#Python #PEP810 #LazyImports #CPython #Performance #SoftwareEngineering #MetaCinder #Python315 #StartupTime #TechnicalDeepDive
🐍🚀 Out now: Python 3.15 alpha 7!
This is the first one with lazy imports (PEP 810) and frozendict (PEP 814)! Try it out and give us feedback.
https://discuss.python.org/t/python-3-15-0-alpha-7/106475
☃️ Just one alpha left until the feature freeze! Core team: get your PEPs in!
#Python #Python315 #release PEP810 #LazyImports #PEP814 #frozendict

This is an early developer preview of Python 3.15 Major new features of the 3.15 series, compared to 3.14 Python 3.15 is still in development. This release, 3.15.0a7, is the seventh of eight planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process. During the alpha phase, features may be added up until the start of the beta phase (2026-05-05) and, if necessary, may be modified or deleted up ...
The Story of Python's Lazy Imports: Why It Took Three Years and Two Attempts
#Python #PEP810 #LazyImports #CPython #Performance #SoftwareEngineering #MetaCinder #Python315 #StartupTime #TechnicalDeepDive
Lazy imports are coming to Python :tada:
PEP 810: Explicit lazy imports - PEPs - Discussions on Python.org
https://discuss.python.org/t/pep-810-explicit-lazy-imports/104131/466
Dear PEP 810 authors. The Steering Council is happy to unanimously[1] accept “PEP 810, Explicit lazy imports”. Congratulations! We appreciate the way you were able to build on and improve the previously discussed (and rejected) attempt at lazy imports as proposed in PEP 690. We have recommendations about some of the PEP’s details, a few suggestions for filling a couple of small gaps, and we have made decisions on the alternatives that you’ve left to the SC, all of which I’ll outline below. ...
The Steering Council has accepted PEP 810 (explicit lazy imports) for Python 3.15!
https://discuss.python.org/t/pep-810-explicit-lazy-imports/104131/466
Dear PEP 810 authors. The Steering Council is happy to unanimously[1] accept “PEP 810, Explicit lazy imports”. Congratulations! We appreciate the way you were able to build on and improve the previously discussed (and rejected) attempt at lazy imports as proposed in PEP 690. We have recommendations about some of the PEP’s details, a few suggestions for filling a couple of small gaps, and we have made decisions on the alternatives that you’ve left to the SC, all of which I’ll outline below. ...
I benchmarked `--help` on one of my CLIs with the reference implementation for PEP 810 (Explicit lazy imports).
Because my CLI already does the "inline imports" thing of moving them into functions just before they get used, I got a speedup of x1.3.
Then I moved all the imports to the top like normal, and got a speedup of x2.9!
https://hugovk.dev/blog/2025/lazy-imports/
#Python #Python315 #PEP810 #LazyImports #lazy