The Python development team has announced Python 3.15, the latest stable version of the popular open-source programming language.
Arriving a year after Python 3.14, a notable improvement concerns Python’s experimental JIT compiler. On x86-64 Linux systems, the upgraded compiler delivers a 7–8% geometric mean performance improvement over the standard interpreter. On AArch64 macOS, the improvement reaches 11–12% compared to the tail-calling interpreter.
Another major addition is explicit lazy imports, introduced through PEP 810. Traditionally, Python loads imported modules immediately, even when an application does not need them during execution. However, this can slow startup times, especially for larger applications with many dependencies.
Python 3.15 addresses this with a new lazy keyword, allowing developers to defer loading modules until first use. For example, lazy import json declares the module without immediately loading it. The import completes when the application first accesses it.
The release also makes UTF-8 the default text encoding, as specified in PEP 686. This change improves consistency across operating systems and reduces encoding problems when applications handle text files, especially when moving between Linux, Windows, and macOS.
On the language side, Python 3.15 introduces two new built-in types. The first, frozendict, provides an immutable dictionary whose contents cannot be modified after creation. It preserves insertion order and can also be used as a hashable object when its keys and values are hashable.
The second, sentinel, offers a standardized mechanism for creating unique marker values. Such values are commonly used in APIs to distinguish between an argument that was not provided and one explicitly assigned a value such as None.
Beyond the language, Python 3.15 introduces a dedicated profiling package that unites profiling tools under a common interface. Among its additions is Tachyon, a high-frequency statistical sampling profiler designed to analyze running Python processes with minimal overhead.
Tachyon can attach to an existing Python process without requiring a restart or code modifications. It supports multiple profiling modes, including CPU time, wall-clock time, and time spent holding the Global Interpreter Lock. Developers can also generate flame graphs and other visualizations to identify performance bottlenecks.
Linux users and system administrators will also benefit from another noteworthy change: CPython now enables frame pointers by default on supported platforms, making native stack tracing more reliable and improving compatibility with system-level profiling and debugging tools, including those based on eBPF.
Python 3.15 also expands support for free-threaded builds, which allow Python threads to execute without the traditional Global Interpreter Lock. The release introduces stable ABI support for free-threaded Python and related C API improvements, making it easier for extension developers to support this execution model.
Additional changes include improved error messages, more color in command-line output, new typing capabilities, and enhancements to the C API. The official 64-bit Windows binaries now use the tail-calling interpreter, and the macOS installers include free-threading support by default.
For those interested in exploring the release interactively, Python developer Barry Warsaw has also introduced whatsnewt, a terminal-based adventure game featuring 18 puzzles based on Python 3.15’s new capabilities. The easiest way to play it is to run uvx --python 3.15 whatsnewt.
For more information, refer to the official release announcement or the comprehensive What’s New in Python 3.15 documentation.
