Python 3.15 is out, and this one is not a maintenance release. Lazy imports, a built-in immutable dict type, a production-ready sampling profiler, and a faster interpreter all land together. Several of these features spent years on the wishlist and two of them survived failed PEPs to get here. If you are running Python in production, there is something in this release that affects your startup time, your type safety, your profiling workflow, or your Windows builds — possibly all four.
Lazy Imports: Three Years, Two PEPs, One Keyword
The headline feature is explicit lazy imports via PEP 810. Write lazy import json and Python binds the name immediately but loads the module only when you first touch it. The earlier attempt, PEP 690, was rejected because it modified CPython’s internal dictionary type — too invasive to maintain. PEP 810 uses proxy objects instead, keeping the complexity contained and the opt-in explicit.
The measured gain is 7–8% on startup benchmarks (x86-64 Linux, geometric mean). That sounds modest until you consider CLI tools and microservices that import heavy dependency chains they may not use on every invocation. A sluggish --help that imports NumPy before checking flags is exactly what this fixes.
Two constraints matter: lazy imports are module-scope only, and star imports cannot be lazy. Use lazy import inside a function and you get a SyntaxError. Libraries that want to adopt lazy behavior without breaking 3.14 compatibility can list module names in a __lazy_modules__ variable at the top of a file — 3.15 defers those imports, older versions ignore the variable.
One caution: a last-minute bug in complex import graphs forced a surprise third release candidate. Test your dependency tree before shipping to production.
lazy import json
lazy from pathlib import Path
# json loads only when json.dumps() or json.loads() is first called
frozendict: Finally a Built-In Immutable Dict
Python developers have been writing fake-immutable dicts for over a decade — tuples of items, custom classes, MappingProxyType wrappers. PEP 814 ends that with a built-in frozendict type. It is immutable, it preserves insertion order, and when all keys and values are hashable, the frozendict itself is hashable — meaning it can be a dictionary key, a set member, or an argument to functools.cache without converting it to a tuple first.
config = frozendict({'timeout': 30, 'retries': 3})
# Use as a dict key
results = {config: response}
# Use with functools.cache
@functools.cache
def process(options: frozendict): ...
One thing to watch: frozendict is not a subclass of dict. Code that checks isinstance(x, dict) will return False. The fix is to check against collections.abc.Mapping instead, which is the right abstraction regardless.
Tachyon: Profile Production Without Restarting
The profiling.sampling module — called Tachyon in community discussions — is a statistical sampling profiler that ships in the standard library. The critical property is that it can attach to a running process without code changes or a restart:
python -m profiling.sampling run app.py
python -m profiling.sampling attach -d 5 <PID>
python -m profiling.sampling run --flamegraph app.py
Sampling rate reaches 1,000,000 Hz with near-zero overhead. The flamegraph output is an interactive HTML file. The difference from cProfile is conceptual: cProfile instruments every call; Tachyon watches the process and samples. That distinction is what makes profiling a live production service viable instead of dangerous.
UTF-8 by Default: Windows Teams, Pay Attention
Python 3.15 makes UTF-8 the default text encoding across all platforms. On Linux and macOS, this changes little — most systems already use a UTF-8 locale. On Windows, it means the legacy ANSI code page is no longer the fallback for open() calls, stdin, stdout, and pipes.
The risk is silent and ugly: files written in a legacy encoding will produce UnicodeError or mojibake instead of reading correctly. The fix is mechanical — add encoding='utf-8' to every open() call. That is safe on Python 3.14 and earlier too, so there is no reason to wait.
# Add encoding= now, before you upgrade
with open('data.csv', encoding='utf-8') as f:
...
To test before upgrading: run your test suite with PYTHONUTF8=1 set on Python 3.14. If it passes, the encoding change is a non-event for you.
Faster Interpreter: One Win Is Production-Ready, One Is Not
The tail-calling interpreter on Windows x86-64 delivers a 15–20% speedup on pyperformance benchmarks, with up to 40% on real-world pure-Python code. This requires a build with Visual Studio 2026 (MSVC 18), which the official python.org Windows installer uses. It is not experimental.
The JIT is a different story. It delivers 7–8% on Linux and 11–12% on macOS AArch64, but it remains opt-in via PYTHON_JIT=1 and is still labeled experimental. Individual benchmarks range from -15% to over 100% depending on the workload. The JIT is included in official installers but off by default — treat it as a preview.
What to Do Today
Python 3.15 is worth upgrading to, but do not rush it. Three actions before you flip the switch:
- Run
PYTHONUTF8=1 python -m pytestagainst your current codebase. Fix any encoding failures you find. - Audit any code that checks
isinstance(x, dict)and update tocollections.abc.Mappingif the value might be a frozendict. - Test lazy import adoption on a non-critical module first to surface any import-graph edge cases before they reach production.
The full list of changes is in the official What’s New in Python 3.15 document. The Real Python deep dive covers every feature with worked examples. For the profiler, the profiling.sampling docs are the right starting point.

