Python 3.14: What’s New and Should You Upgrade?
What is new in Python 3.14: template strings, deferred annotations, supported free threading, multiple interpreters, zstd and what to check before upgrading.
Python 3.14 is a mature release whose headline changes are template strings, lazily evaluated annotations, subinterpreters in the standard library and an officially supported free-threaded build. It was released on 7 October 2025 and is supported until October 2030.
At a glance
| Feature | PEP | What it does |
|---|---|---|
| Template strings | 750 | t"..." literals that return a Template object, not a str |
| Deferred evaluation of annotations | 649, 749 | Annotations are evaluated only when needed |
| Free-threaded Python officially supported | 779 | The no-GIL build is supported but still optional |
| Multiple interpreters | 734 | concurrent.interpreters module |
| Zstandard compression | 784 | compression.zstd module |
except A, B: without brackets | 758 | Allowed when there is no as clause |
| Safe external debugger interface | 768 | Attach debuggers and profilers to running processes |
Warning on control flow in finally | 765 | return, break and continue in finally raise a SyntaxWarning |
Template strings (PEP 750)
A t-string uses a t prefix instead of an f. It keeps the static text and the interpolated values separate, so code can treat the values safely before joining them.
from string.templatelib import Template, Interpolation
import html
def render(template: Template) -> str:
parts = []
for part in template:
if isinstance(part, Interpolation):
parts.append(html.escape(str(part.value)))
else:
parts.append(part)
return "".join(parts)
user_input = "<script>alert(1)</script>"
print(render(t"<p>Hello {user_input}</p>"))
# <p>Hello <script>alert(1)</script></p>
print(f"<p>Hello {user_input}</p>")
# <p>Hello <script>alert(1)</script></p>
The same approach applies to SQL, shell commands and log messages. A t-string is not a str, so passing one to code that expects a string needs a function like render in between.
Deferred evaluation of annotations (PEP 649 and 749)
Annotations on functions, classes and modules are stored and evaluated only when needed. You no longer need quotes around forward references, and the annotationlib module reads annotations in three formats:
from annotationlib import get_annotations, Format
class A:
x: Undefined # no quotes needed
get_annotations(A, format=Format.FORWARDREF)
# {'x': ForwardRef('Undefined', is_class=True, owner=<class '__main__.A'>)}
get_annotations(A, format=Format.STRING)
# {'x': 'Undefined'}
A.__annotations__
# NameError: name 'Undefined' is not defined
The What’s New page says that if you use from __future__ import annotations only to avoid quoting forward references, you may be able to remove it once you support only 3.14 and newer. Code that reads __annotations__ directly may need to move to annotationlib.get_annotations. See the type hints guide for annotating code.
Free-threaded Python is supported (PEP 779)
The free-threaded build moved from experimental to officially supported, which the release notes call phase II: supported but still optional. Whether it ever becomes the default is described as undecided. The implementation described in PEP 703 is finished, including the C API changes, and the performance penalty on single-threaded code is now roughly 5 to 10 percent, depending on platform and compiler (3.13 warned of a substantial hit). See free threading explained and what was in 3.13.
Multiple interpreters and Zstandard
The concurrent.interpreters module exposes a capability that was previously only available from the C API: several isolated interpreters in one process, with true multi-core parallelism.
from concurrent import interpreters
interp = interpreters.create()
interp.exec("print('hello from a subinterpreter')")
interp.close()
PEP 784 adds the compression.zstd module, and a compression package whose lzma, bz2, gzip and zlib modules re-export the existing ones:
from compression import zstd
data = b"python " * 1000
packed = zstd.compress(data)
print(len(data), "->", len(packed), zstd.decompress(packed) == data)
# 7000 -> 25 True
Compare the concurrency options in asyncio vs threading vs multiprocessing.
Smaller changes
- Brackets are optional in
except(PEP 758).except TimeoutError, ConnectionRefusedError:is valid in 3.14 when there is noasclause. Withas, Python 3.14 still reportsmultiple exception types must be parenthesized when using 'as'. On 3.13 the bracketless form is aSyntaxError. - Syntax highlighting in the default interactive shell, and colour in several standard library command-line tools.
- A tail-calling interpreter, opt-in and needing Clang 19 or newer on x86-64 or AArch64. The release notes report a 3 to 5 percent geometric-mean speed-up on
pyperformance. - An experimental JIT in the official macOS and Windows binaries, enabled with
PYTHON_JIT=1. The notes say it is not recommended for production use and that its effect ranges from 10 percent slower to 20 percent faster, depending on the workload. - Garbage collector. Python 3.14.0 to 3.14.4 shipped an incremental collector. Because of reports of significant memory pressure in production, it was reverted to the generational collector from 3.13 in Python 3.14.5. If you read older articles about an incremental GC in 3.14, this is why they no longer apply.
What to check before upgrading from 3.13
- Removed APIs: the asyncio child watchers,
ast.Num,ast.Str,ast.Bytes,ast.NameConstantandast.Ellipsis,pkgutil.get_loaderandpkgutil.find_loader, andurllib.request.URLopenerandFancyURLopener. - Multiprocessing: on Unix platforms other than macOS the default start method is now
forkserver, notfork. - Annotations: code that inspects
__annotations__directly.
The full list, with a test you can run, is in Python 3.13 end of life, which covers the move to 3.14.
3.14 or 3.15?
3.15 was released on 9 October 2026 with lazy imports and a faster experimental JIT; see Python 3.14 vs 3.15 and what is new in 3.15. On PyPI on 4 November 2026, NumPy, pandas, SciPy, Pillow, Matplotlib and scikit-learn publish wheels for both. If you are on 3.12 or older, 3.14 is a sound target; see Python 3.12 end of life.
How to try it
With uv: uv python install 3.14, then uv run --python 3.14 python. Test your project in a fresh virtual environment with python -W error -m pytest.
Frequently Asked Questions
When was Python 3.14 released?
Python 3.14 was released on 7 October 2025. It receives bugfix releases until about October 2027 and security fixes until October 2030.
What are t-strings in Python 3.14?
Template strings, written with a t prefix instead of an f, such as t’Hello {name}’. Unlike f-strings they return a Template object that keeps the static and interpolated parts separate, so a library can process the values, for example by escaping them for HTML or SQL, before building the final string.
Is free threading supported in Python 3.14?
Yes. PEP 779 made the free-threaded build officially supported in 3.14 and no longer experimental. It is still an optional, separate build, and the decision to make it the default is left for the future.
Is Python 3.14 faster than 3.13?
There is no single headline figure. A new tail-calling interpreter is 3 to 5 percent faster on the pyperformance suite, but it is opt-in and needs Clang 19 or newer. The JIT in the official macOS and Windows binaries is experimental and ranges from 10 percent slower to 20 percent faster depending on the workload.
Should I upgrade to Python 3.14?
For most projects, yes, once your dependencies support it. It is supported until October 2030, and NumPy, pandas, SciPy and Pillow already publish wheels for it. Python 3.15, released on 9 October 2026, is the newer option.