Allgemein

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!

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 bytes objects 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:

Shell

$ 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!

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:

Python
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.

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 ]