What are the major new features introduced in the latest Python version?
ForumsPython1 answer
ForumsPython1 answer
What are the major new features introduced in the latest Python version?
Know the answer? Post it — somebody with the same question will find it here.
Join to answer this question
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 20 SHARP for every answer they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterMembers onlyAnswer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
Tahir AnsariPosted Nov 6, 2026, 10:15 AM EST
The latest Python version is 3.15, released on 9 October 2026. Here are its biggest changes compared with 3.14:
1. Explicit lazy imports (PEP 810)
The new
lazysoft keyword delays loading a module until the imported name is first used. This can improve startup time, while keeping imports at the top of the file.lazy import json lazy from pathlib import Path print("Starting...") # Neither module is fully loaded yet data = json.loads('{"a": 1}') # json loads herelazyworks only at module level, so using it inside a function, class, ortryblock raises aSyntaxError. Star imports can't be lazy either. If a lazy import fails, the error appears at first use rather than at the import line.2. Built-in frozendict (PEP 814)
frozendictis an immutable dictionary. It is hashable if all its keys and values are hashable, and it isn't a subclass ofdict. It keeps insertion order, but order is ignored when comparing two objects.config = frozendict(host="localhost", port=8080) cache = {config: "connected"} # Can be used as a dict key config["port"] = 9000 # TypeError3. Built-in sentinel (PEP 661)
The new
sentineltype creates unique marker values that have a concise representation and keep their identity when copied. It's useful whenNoneis a valid value.4. Unpacking in comprehensions (PEP 798)
Comprehensions and generator expressions now support
*and**unpacking.5. UTF-8 by default (PEP 686)
When you don't specify an encoding, operations like
open("file.txt")now use UTF-8, regardless of the system environment. This matters most for Windows code that relied on the old locale-based default. To restore the old behavior, usePYTHONUTF8=0or-X utf8=0. Passingencoding=explicitly is still the safest choice across versions.6. New profiling tools, including Tachyon (PEP 799)
The new
profilingpackage includesprofiling.tracingfor deterministic tracing andprofiling.samplingfor statistical sampling.The sampling profiler, Tachyon, can attach to a running process without code changes or a restart, which makes it useful for production debugging. It supports flame graphs, heatmaps, a live terminal view, and async-aware profiling.
7. Faster experimental JIT
The experimental JIT compiler was significantly upgraded. Reported gains are about 7–8% on x86-64 Linux and 11–12% on AArch64 macOS.
8. Better error messages
Python now suggests fixes for more mistakes, including method names from languages like JavaScript, Java, Ruby, and C#.
9. Other notable changes
TypedDictwith typed extra items (PEP 728),TypeForm(PEP 747), and disjoint bases (PEP 800).abi3t(PEP 803).TaskGroup.cancellets you stop a task group early.Before you upgrade
profilemodule is deprecated and scheduled for removal in Python 3.17, whilecProfileremains as an alias.re.match()is soft deprecated in favor of the clearerre.prefixmatch(), but soft deprecation doesn't mean it's being removed.Sources: What's new in Python 3.15 – Python documentation | Python 3.15.0 release report – Zeli