English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Python 3.15 Enters RC Stage: Lazy Imports, frozendict, and a Zero-Overhead Sampling Profiler

Forum topic · 小凯 · 2026-08-15

Summary

Python 3.15.0 RC1 shipped on August 4, 2026, freezing the feature set ahead of a planned October 1 final release. The release focuses on concrete performance and ecosystem changes rather than syntax sugar. PEP 810 introduces a lazy soft keyword so imports (e.g., lazy import pandas as pd) defer module loading until first use. PEP 814 adds a built-in frozendict alongside PEP 661's sentinel, though frozendict is not a dict subclass, breaking isinstance checks. PEP 799 consolidates profiling into a new profiling namespace, including Tachyon, the standard library's first zero-overhead statistical sampler supporting up to 1,000,000 Hz, live process attachment, async, and free-threaded builds. The experimental JIT is 8–13% faster on x86-64 Linux and AArch64 macOS, with stabilization targeted at Python 3.16 under the draft PEP 836 roadmap. Related ecosystem news covers uv 0.12.0, Ruff 0.16.0's default rule expansion, and PyPI policy changes. Library maintainers are urged to test against RC1 and publish 3.15 wheels now.

On August 4, 2026, Python 3.15.0 reached its first release candidate (RC1). From this point the 3.15 feature set is locked — only clear bug fixes are allowed. RC2 is scheduled for September 1, and the final 3.15.0 release is planned for October 1. For teams that skipped the beta series, RC1 is the last window to run test suites and find breakages before they surface in someone else's production incident.

3.15 is not another "syntax sugar" release. It simultaneously touches startup speed, built-in immutable types, the standard library profiler, and the JIT roadmap.

Key numbers for 3.15

  • Faster startup: PEP 810 introduces a lazy soft keyword; module loading is deferred until a name from the import is actually touched. With lazy import pandas as pd, the module is not loaded and does not enter sys.modules until pd.DataFrame() is called. For CLI tools and scripts that import a lot but use a little, startup time drops noticeably. It is explicit opt-in — not a silent behavior change to existing imports.
  • New built-in types: frozendict (PEP 814) and sentinel (PEP 661). Like frozenset, frozendict is an immutable built-in — a hashable, read-only dict that replaces the defensive "copy a dict so callers can't mutate it" idiom. sentinel turns the "unique marker object" pattern (the hand-written _MISSING = object()) into something the standard library and type checkers natively understand. One gotcha: frozendict inherits directly from object, not from dict, so any isinstance(x, dict) check will silently reject it — library authors should use isinstance(x, (dict, frozendict)) or check collections.abc.Mapping instead.
  • A production-grade profiler: PEP 799 consolidates Python's profiling tools into a unified profiling namespace — profiling.tracing (deterministic call tracing, successor to cProfile) and profiling.sampling (backed by a high-frequency statistical sampler called Tachyon). Tachyon is the first zero-overhead statistical profiler in the standard library: it reads process call stacks externally, does not instrument function calls, samples at up to 1,000,000 Hz, can attach to a running process without restart or code changes, and supports async functions, free-threaded builds, and multithreaded programs. cProfile remains as a backward-compatibility alias.
  • Real JIT progress: The 3.15 JIT is 8–9% faster than the standard interpreter on x86-64 Linux (geometric mean) and 12–13% faster on AArch64 macOS. The team rewrote the tracing frontend, added basic register allocation, and increased JIT code coverage by 50%. It remains experimental, requiring the --enable-experimental-jit build flag — don't run it in production. A stable JIT targets Python 3.16.
  • Other changes: UTF-8 as the default encoding (PEP 686 rollout continues), unpacking in comprehensions (PEP 798), TypedDict support for typed extra keys (PEP 728), TypeForm (PEP 747), and disjoint bases in the type system (PEP 800). Official Windows 64-bit binaries use a tail-calling interpreter, and official macOS binaries install free-threading support by default.

A governance turning point for the JIT roadmap

Last month's big development was the Steering Council giving CPython's JIT a six-month ultimatum: either produce a standard-track PEP or remove the JIT from main. The response was PEP 836, "JIT Go Brrr: The Path to a Supported JIT Compiler for CPython," published July 2 by Savannah Ostrowski, Ken Jin, and Brandt Bucher. It lays out a roughly two-and-a-half-year roadmap from 3.16 to 3.17: the JIT moves from today's trace-based recording toward method-based compilation, aims for at least a 20% improvement over the free-threaded interpreter by 3.17, without regressing debugger and profiler support, while clarifying how packagers distribute the JIT. The PEP is still a draft and the council has not ruled, but turning a governance ultimatum into a public roadmap within a month is a process worth watching.

Synchronized shocks in the packaging ecosystem

In the same window, Astral shipped two breaking minor releases. uv 0.12.0 (July 28) is the first minor bump since March; Ruff 0.16.0 landed five days earlier. uv's visible change is that uv init regenerates packageable projects with a src/ layout; the more subtle but important half is fixing --require-hashes, which previously only warned instead of actually verifying hashes in requirements.txt, plus rejecting MD5-only digests and wheels that could overwrite the interpreter (including Python.exe — the old check missed this on case-insensitive filesystems). Ruff 0.16.0's default rule set jumped from 59 to 413 rules, which will flag far more issues across existing projects. Separately, PyPI announced it will stop accepting files added more than 14 days after release, nominations for the first Python Packaging Council are opening, and core developer Petr Viktorin was named a PSF Fellow.

A reminder for library maintainers

RC1 locks features; RC2 locks code. If you maintain a third-party library, test against RC1 now and publish 3.15 wheels to PyPI — binary wheels built against an RC remain valid for future 3.15 releases. Most application projects don't need to upgrade on day one; treat it like any .0 release and wait for 3.15.1 or .2, unless lazy imports or the JIT happen to solve a specific problem you already have. Third-party support for a new Python typically lags the language release by weeks to months — library authors testing early is what lets downstream projects follow.

Tags

#python#python-3-15#lazy-imports#frozendict#profiling#jit#packaging#release-candidate

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178633524