Lazy Imports Land in Python and Other Python News for December 2025
A lot happened last month in the world of Python! The core developers pushed ahead on Python 3.15, accepting PEP 810 to bring explicit lazy imports to the language. PyPI tightened account security, Django 6.0 landed with a slew of new features while celebrating twenty years of releases, and the Python Software Foundation (PSF) laid out its financial outlook and kicked off a year-end fundraiser.
Letâs dive into the biggest Python news from the past month!
Join Now: Click here to join the Real Python Newsletter and youâll never miss another Python tutorial, course, or news update.
Python Releases and PEP Highlights
Last month brought forward movement on Python 3.15, with a new alpha release and a major PEP acceptance. Windows users also got an update to the new Python install manager thatâs set to replace the traditional installers.
Python 3.15.0 Alpha 2 Keeps the Train Moving
Python 3.15âs second alpha, 3.15.0a2, arrived on November 19 as part of the languageâs regular annual release cadence. Itâs an early developer preview that isnât intended for production, but it shows how 3.15 is shaping up and gives library authors something concrete to test against.
Like alpha 1, this release is still relatively small in user-visible features, but it continues the work of:
- Making UTF-8 the default text encoding for files that donât specify an encoding, via PEP 686
- Providing a dedicated profiling API designed to work better with modern profilers and monitoring tools, via PEP 799
- Exposing lower-level C APIs for creating
bytesobjects more efficiently, via PEP 782
If you maintain packages, now is a good time to start running tests against the alphas in a separate environment so you can catch regressions early.
You can always confirm which Python youâre running with python -VV:
$ python -VV
Python 3.15.0a2 (main, Nov 19 2025, 10:42:00) [GCC ...]
Just remember to keep the alpha builds isolated from your everyday projects!
PEP 810 Accepted: Explicit Lazy Imports
One of the monthâs most consequential decisions for the language was the acceptance of PEP 810 â Explicit lazy imports, which you may have read about in last monthâs news. The Python Steering Council accepted the proposal on November 3, only a month after its formal creation on October 2. With the PEP moving from Draft to Accepted, itâs now targeted for inclusion in Python 3.15!
Note: One of the PEPâs authors, Pablo Galindo Salgado, has been a frequent guest on the Real Python Podcast.
PEP 810 introduces new syntax for imports that are evaluated only when first used, rather than at module import time. At a high level, youâll be able to write:
lazy import json
def parse():
return json.loads(payload)
In this example, Python loads the json module only if parse() runs.
The goals of explicit lazy imports are to:
- Improve startup time for large applications with many rarely used imports
- Break tricky import cycles without resorting to local imports inside functions
- Give frameworks and tools a clear, explicit way to defer expensive imports
Lazy imports are entirely opt-in, meaning that only imports marked as lazy change their behavior. The PEP is also careful to spell out how lazy modules interact with attributes like __all__, exception reporting, and tools such as debuggers.
Note: The implementation work is still underway, so you wonât see the new syntax in 3.15.0a2 yet.
If you maintain a framework, CLI tool, or large application, itâs worth reading through the PEP and thinking about where lazy imports could simplify your startup path or trim cold-start latency.
Pythonâs New Install Manager Moves Forward on Windows
Read the full article at https://realpython.com/python-news-december-2025/ »
[ Improve Your Python With đ Python Tricks đ â Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
