5 min read

Exploring Python 3.15: What's New in Alpha 7

A deep dive into the latest features of Python 3.15.0 Alpha 7, including lazy imports, frozendict, and performance boosts.

Exploring Python 3.15: What's New in Alpha 7

The road to Python 3.15 is well underway, and with the release of Python 3.15.0 Alpha 7, we are seeing some of the most exciting changes to the language in years. This release is the second-to-last alpha before the feature-freeze in May, giving us a clear picture of what the final version will look like.

From performance breakthroughs to highly requested syntax additions, let’s explore the highlights of this latest update.

Performance: The JIT Era

One of the most significant focus areas for the 3.15 cycle is the Just-In-Time (JIT) compiler. Alpha 7 shows impressive progress:

  • x86-64 Linux: A 3-4% geometric mean performance improvement.
  • AArch64 macOS (Apple Silicon): A substantial 7-8% speedup compared to the standard interpreter.

Additionally, PEP 799 introduces a new Statistical Profiler. This low-overhead sampling profiler is designed for production environments where traditional tools would be too heavy, allowing for real-world performance monitoring without sacrificing responsiveness.

New Language Features

Explicit Lazy Imports (PEP 810)

If you’ve ever dealt with slow application startup times due to heavy imports (like pandas or tensorflow), this is for you. You can now explicitly mark imports as lazy, meaning the module is only loaded when you actually use it.

# The module is not loaded yet
import lazy pandas as pd

def process_data(data):
    # pandas is loaded here, on first access
    return pd.DataFrame(data)

Built-in frozendict (PEP 814)

Python finally has a built-in immutable dictionary. Similar to how a tuple is an immutable list, a frozendict is hashable and perfect for use as a dictionary key or for safe caching.

from types import frozendict

immutable_config = frozendict({"api_version": "v1", "timeout": 30})
# This will raise an error
# immutable_config["timeout"] = 60 

Unpacking in Comprehensions (PEP 798)

The * and ** operators are now available within list, set, and dictionary comprehensions, making them consistent with standard collection literals.

defaults = {"theme": "dark", "notifications": True}
user_settings = [{"id": 1, "name": "Alice", **defaults}, {"id": 2, "name": "Bob", **defaults}]

Better Typing and Tooling

  • UTF-8 by Default (PEP 686): Python now defaults to UTF-8 across all platforms, ending decades of encoding headaches on Windows.
  • TypedDict Improvements (PEP 728): You can now define types for extra items in a TypedDict.
  • Improved Error Messages: Tracebacks continue to get more helpful, pinpointing the exact cause of errors with better precision.

What’s Next?

Python 3.15 will enter its Beta phase on May 5, 2026. After that, no new features will be added, and the focus will shift entirely to stability and bug fixes. The final release is expected around October 2026.

Are you excited about these changes? Lazy imports and frozendict are definitely game-changers for large-scale Python applications!


Stay tuned for more updates on Open Source and the Python ecosystem. Happy coding!

Enjoyed this read?

Join our newsletter for more engineering insights.

Start a Conversation