AI NewsDev toolsAnnouncement

Python 3.15.0 ships with lazy imports, UTF-8 default and faster JIT

Python 3.15.0 is now the stable release, with 5,643 commits from 1,012 contributors, a UTF-8 default encoding, explicit lazy imports for faster startup, and an upgraded experimental JIT.

AI News

Editorial2 min read

LinkedInX

Why it mattersA Python service with slow startup or a tight memory budget now has lazy imports as a shipping feature, and anybody running the JIT in production has a Python version that is faster than the standard interpreter for the first time.

The stable Python 3.15.0 is out, with 5,643 commits from 1,012 contributors since 3.14. The release notes name the start-up time of a Python process, the default encoding of a text file, and the speed of the experimental JIT as the three changes most teams will feel first.

The Python Software Foundation describes the release as a routine stable version, available today for Linux, macOS and Windows from python.org. Hugo van Kemenade is the release manager for both 3.14 and 3.15 through the Sovereign Tech Fellowship.

What changes for a running program

PEP 810 adds explicit lazy imports: a module can declare that a given import is not resolved until the symbol is used, so a program that starts, reads a config file and exits does not pay for every library its main module reaches for. PEP 686 makes UTF-8 the default text encoding, so a file opened without an explicit encoding argument no longer picks up whatever the operating system is configured to use.

PEP 798 extends unpacking to comprehensions. PEP 661 adds a sentinel built-in type and PEP 814 adds a frozendict. PEP 829 defines a package startup configuration file, which lets a library declare import hooks and warning filters without touching user code.

The JIT is now faster than the interpreter

The release notes say the experimental JIT compiler shows a 7 to 8 percent geometric-mean speed-up over the standard interpreter on x86-64 Linux, and 11 to 12 percent over the tail-calling interpreter on AArch64 macOS. Those are the Python Software Foundation's own numbers, measured against its own build. The official Windows 64-bit binary now uses the tail-calling interpreter, and the official macOS binary installs free-threading support by default.

PEP 799 adds a profiling package and tachyon, a high-frequency statistical sampling profiler. The release notes also list typing changes (PEP 728 for TypedDict with typed extra items, PEP 747 for TypeForm, PEP 800 for disjoint base classes) and C API changes (a new PyBytesWriter, finalisation protection, and a stable ABI for free-threaded builds).

One thing to check before upgrading

The release notes carry a warning for macOS 27 users: IDLE and other Tk-based applications can hang when a menu opens a dialog, because of an operating-system behaviour change that the Tk toolkit has not yet caught up with. The issue affects every current Python version. A team on an older macOS, or without Tk-based tooling, is clear.

For a web service, the honest consequence is small. A 3.14-to-3.15 move is a point release with new typing surface, a few standard-library additions and a start-up win worth measuring on your own code. The run-time gain on the standard interpreter is modest, and the JIT remains experimental. A Python 3.15 upgrade is a straightforward one to try, and a good moment to put the JIT on a profiling run on a service that is CPU-bound.

Source

Python 3.15.0 release page, Python Software Foundation.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project