Python 3.15 Is Almost Here: 7 Features Developers Should Know
Python 3.15 is close enough to matter now. The second release candidate arrived on 1 September 2026, and the core team plans the final release for 1 October. That leaves developers a useful window: understand the changes, test the ones that touch your code, and upgrade with fewer surprises.
This release does not depend on one headline feature. Instead, it improves several places where Python projects often feel friction: startup time, immutable data, API design, profiling, debugging, JIT execution, and native extensions. Here are the seven changes worth knowing before Python 3.15 reaches production.
1. Explicit lazy imports can speed up startup
Large applications often import far more code than they need for a single command. Python 3.15 introduces explicit lazy imports through PEP 810, so you can defer an import until the program actually uses it.
from lazy import expensive_reporting_module
def generate_report():
return expensive_reporting_module.build()
First, measure startup time before you change anything. Then target optional integrations, command-line subcommands, and slow third-party packages. However, do not make every import lazy by default: an error inside a deferred import now appears at the point of use, rather than at startup. That trade-off makes lazy imports most useful when the boundary is clear and well tested.
2. frozendict gives immutable mappings a proper home
Python has long offered tuples and frozen sets for immutable collections, but it has lacked a built-in immutable dictionary. PEP 831 adds frozendict, a read-only mapping that supports hashable values.
from builtins import frozendict
request_options = frozendict(
timeout=5,
retries=2,
)
As a result, you can use a configuration mapping as a dictionary key, store it safely in a set, or share it without worrying that another part of the program will mutate it. This is especially helpful for caches, configuration objects, and functional-style transformations. Still, choose it for genuine immutability; a normal dictionary remains simpler when code needs regular updates.
3. Named sentinels make APIs easier to read
Many Python APIs need to distinguish between “the caller supplied nothing” and “the caller explicitly supplied None.” Developers often create an anonymous object() for that job. PEP 661 formalises named sentinels, so that intent becomes visible in code, logs, and debugging sessions.
from typing import Sentinel
NOT_GIVEN = Sentinel("NOT_GIVEN")
def configure(timeout=NOT_GIVEN):
if timeout is NOT_GIVEN:
return default_timeout()
return timeout
For example, this pattern keeps an optional value separate from an omitted value. It also gives type checkers and readers a clearer contract. Therefore, replace ad-hoc sentinels where the distinction forms part of a public or long-lived API.
4. Sampling profiler support improves production insight
Profiling should help you find a bottleneck without dramatically changing the workload you want to inspect. Python 3.15 adds the Tachyon sampling profiler API, which samples running code rather than recording every function event.
Traditional tracing can provide precise call data, yet it can also add noticeable overhead. Sampling offers a complementary view: it highlights where the interpreter spends time while keeping the measurement lighter. In practice, use it to investigate real service behaviour, then use a focused profiler or benchmark when you need finer detail.
5. Better stack traces make failures easier to follow
Python 3.15 also improves observability around the call stack. The interpreter can expose richer frame information to tools without making ordinary Python code manage that machinery directly.
That matters most to profilers, debuggers, error-reporting tools, and performance libraries. Meanwhile, application developers gain clearer diagnostics as those tools adopt the new interfaces. If your team depends on native monitoring or tracing software, check its Python 3.15 support before you upgrade a production environment.
6. JIT improvements continue, but benchmarks decide
The experimental just-in-time compiler continues to mature in Python 3.15. The project is refining the runtime and broadening the work that the JIT can optimise. However, the JIT does not promise a universal speed boost for every application.
CPU-bound workloads may benefit; I/O-heavy services may not notice much difference. Therefore, run your own representative benchmark suite, compare throughput and latency, and inspect memory use. A result from a tiny loop rarely predicts the behaviour of a full application.
7. Free-threaded extension work moves closer to practical use
Free-threaded Python allows compatible code to run without the global interpreter lock. Python 3.15 continues that work by improving the ABI and tooling story for C extensions.
Consequently, extension authors can prepare packages that support multi-core execution more cleanly. The opportunity is significant for compute-heavy tasks, but compatibility remains the first question. Test every dependency that ships native code, particularly numerical, data-processing, and machine-learning packages, before you enable free-threaded builds.
A practical Python 3.15 upgrade plan
- Start with a clean test environment. Run your test suite against Python 3.15 RC2 and record failures.
- Check compiled dependencies early. Native packages often set the pace for a runtime upgrade.
- Measure before and after. Test startup, important endpoints, background jobs, and memory use.
- Adopt features deliberately. First try lazy imports or sentinels in one bounded area, then expand only when the result helps.
- Plan the production upgrade after the final release. Keep the current runtime available until your deployment and monitoring checks pass.
Python 3.15 will reward teams that treat it as an engineering opportunity rather than a version-number change. Start with the parts that solve a real problem in your codebase, gather evidence, and leave the rest alone. If you are also building more capable Python workflows, this LangGraph multi-agent systems tutorial series offers a useful next place to explore.
For the full technical detail, read the official What’s New in Python 3.15, along with PEP 810, PEP 831, and PEP 661.