Skip to content

Python 3.15.0 ships with lazy imports and frozendict

Python 3.15.0 arrived October 9 with 5,643 commits from 1,012 contributors: lazy imports, a built-in frozendict, UTF-8 by default and a faster JIT.

By Tech AI Wire Team

4 min read

XLinkedIn
Screenshot of the Python Insider post Python 3.15.0 (final) is here!, by Hugo van Kemenade, dated October 9, 2026, with the 3.15 release artwork.

By the numbers

commits since Python 3.14
5,643
contributors to the release
1,012
JIT speedup on x86-64 Linux, geometric mean
7-8%
roughly when security updates end, per PEP 602
2031

Python 3.15.0 was released on October 9, 2026, the language's yearly feature release. It brings explicit lazy imports, a built-in frozendict type and UTF-8 as the default text encoding. "Python 3.15.0 is the newest major release of the Python programming language," release manager Hugo van Kemenade wrote on Python Insider. The release took 5,643 commits from 1,012 contributors. It arrives a week later than first planned, after a surprise third release candidate fixed late lazy-import bugs.

The headline features

Each big change comes from a PEP, a Python Enhancement Proposal, the design document for a feature. The release notes list these:

PEPFeatureWhat it does
810Explicit lazy importsLets code delay loading a module until it is first used, for faster startup
814frozendictA built-in dictionary that cannot be changed after it is created
661Sentinel typeA built-in type for unique marker values
686UTF-8 by defaultPython reads and writes text as UTF-8 unless told otherwise
798Unpacking in comprehensionsAllows unpacking inside comprehensions
829Package startup filesNew startup configuration files for packages
799Profiling packageAdds the Tachyon sampling profiler
803, 820, 793Free-threaded stable ABIOne compiled extension can work across free-threaded builds
831Frame pointersTurned on by default in builds

Typing gets three changes too: PEPs 728, 747 and 800. The experimental JIT compiler, error messages and command-line colors were also improved, the What's New page says.

The UTF-8 change matters most on Windows, Linux Compatible reports. Code that relied on the old default encoding can switch back with PYTHONUTF8=0.

Faster, but not everywhere

The JIT, a compiler that turns hot Python code into machine code while it runs, is now faster. Python Insider gives these geometric-mean gains:

PlatformJIT gain
x86-64 Linux7-8% over the standard interpreter
AArch64 macOS11-12% over the tail-calling interpreter

The results vary widely by workload. Individual benchmarks range from about 15% slower to more than 100% faster, Linux Compatible reports.

The official installers changed too. Windows 64-bit builds now use the tail-calling interpreter, a faster way to run Python's main loop. Linux Compatible puts that gain at 15-20%, and up to 40% for small, long-running pure-Python scripts. The official macOS installers now include free-threading support by default. Free threading lets Python run code on several CPU cores at once without the global interpreter lock.

Known issue on macOS 27

There is one warning for Mac users. On macOS 27.0, IDLE and other tkinter apps "may hang when using an application's menu command that opens a dialog," Python Insider says. The app then has to be force quit.

The Python team blames a change in the operating system and believes it affects all versions of Tk, the toolkit tkinter uses. It is tracked as issue #158053. The release page suggests waiting on macOS 27.0 if you depend on Tk apps.

What is deprecated

Three things are on their way out, according to the release notes and Linux Compatible:

  • The pure-Python profile module is deprecated and will be removed in Python 3.17. cProfile stays.
  • Code-executing lines in .pth files are deprecated in favor of the new startup files from PEP 829.
  • The PyGILState_* C functions are soft-deprecated, but not removed.

Python 3.15 gets two years of bug fixes, then security fixes until about October 2031, Linux Compatible reports, following the schedule in PEP 602.

What this means for developers

  • Try lazy imports on slow-starting tools. Command-line tools and apps with heavy imports benefit most. Test any module that relies on code running at import time, since deferring the import changes when that code runs.
  • Check text handling on Windows. UTF-8 is now the default. Run your file input and output tests on Windows, and use PYTHONUTF8=0 only as a stopgap.
  • Use frozendict for fixed settings. An unchangeable dictionary is safer for configuration and can be used where a hashable value is needed.
  • Benchmark before you count on the JIT. Average gains are modest, and some workloads get slower. Measure your own code.
  • Hold off on macOS 27.0 if you use tkinter. IDLE and Tk apps can hang until the bug is fixed.
  • Move off profile now. It disappears in Python 3.17, so switch to cProfile or the new profiling package.

Before you upgrade production systems, check that your key dependencies support 3.15.

Sources

  1. Python 3.15.0 final is here! - Python Insider
  2. Python Release Python 3.15.0 - Python.org
  3. Python 3.15.0 (final) is here! - Discussions on Python.org
  4. What's new in Python 3.15 - Python documentation
  5. Python 3.15.0 Is Out: Lazy Imports, frozendict, and Faster Speeds - Linux Compatible

Related articles

The weekly digest

One email every Friday with the week's top stories from all six desks: AI, dev tools, coding, the tech industry, startups and what's next. Free, no spam.

Unsubscribe anytime with one click.