Python 3.15 Explained Simply
A plain-language guide to what changed, based on the official Python 3.15 release pages and What’s New documentation.
Python 3.15.0 came out on 9 October 2026. On 21 October, Python 3.15.1 followed as the first maintenance release and an expedited security release. If you’re upgrading, start with 3.15.1.
Why 3.15.1 matters
3.15.1 upgrades the bundled pip to 26.2.2, which includes certifi 2026.10.19, to address the eMudhra / emSign CA certificate security incident. The release notes advise upgrading pip and uv in all existing virtual environments.
1. Lazy imports: faster startup
Normally, Python loads every module the moment you import it, even if you never use it. Python 3.15 adds a lazy keyword to delay that loading.
lazy import jsonprint("Starting up...") # json is not loaded yetdata = json.loads('{"key": "value"}') # json loads here
The module loads only when you first use it. This helps apps that import many modules but use only some of them on each run.
Things to know:
lazyworks only at the top level of a file, not inside functions, classes, ortryblocks.- Star imports and future imports can’t be lazy.
- You can turn it on for a whole program with the
PYTHON_LAZY_IMPORTSsetting. It acceptsall(everything lazy) ornormal(the default, only yourlazyimports). - If a lazy import fails, the error appears when you first use the name, and the traceback shows both places.
2. UTF-8 is now the default
When you open a file without naming an encoding, Python now uses UTF-8 on every system. This avoids many text bugs that used to appear on different operating systems.
Tip: always write the encoding yourself, like open("file.txt", encoding="utf-8"). It keeps your code working the same on every Python version. To get the old behavior back, set PYTHONUTF8=0.
3. Two new built-in types
frozendict is a dictionary that can't be changed after you create it.
a = frozendict(x=1, y=2)
# a["z"] = 3 -> error, it can't be modifiedIt keeps insertion order, but comparing two of them ignores order. It is hashable only if all its keys and values are hashable, so it can’t always be used as a dictionary key.
sentinel lets you create unique marker values with a concise representation.
4. A faster JIT, but still experimental
The JIT compiler is Python’s experiment in making code run faster. The official What’s New page reports, from the pyperformance benchmark suite:
- About 7–8% faster on x86–64 Linux, compared with the standard interpreter.
- About 11–12% faster on AArch64 macOS, compared with the tail-calling interpreter.
Don’t compare these two numbers directly. They are measured against different starting points.
Get Mashroof PP’s stories in your inbox
Join Medium for free to get updates from this writer.
They are also averages. Compared with builds that have no JIT, results range from roughly a 15% slowdown to over a 100% speedup (ignoring one microbenchmark). Test it on your own project before relying on it.
5. A new profiler called Tachyon
Profiling means finding out which parts of your code are slow. Python 3.15 adds a profiling package with a new tool called Tachyon. It can inspect a running program without restarting it or changing your code, and it can produce flame graphs.
The old profile module is deprecated and will be removed in Python 3.17. cProfile stays as an alias.
6. Other useful changes
- Unpacking in comprehensions:
[*items for items in lists]now works. It flattens lists in one line. - Better error messages: if you write
[1, 2, 3].push(4), Python now suggests.append. - Windows builds: the official 64-bit Windows binaries now use the tail-calling interpreter. On one test machine (an AMD Ryzen 7 5800X with Visual Studio 18.1.1), the docs report a 15–20% geometric-mean speedup over the previous interpreter.
- macOS builds: the official macOS installers now include free-threading support by default.
What might break when you upgrade
Python 3.15 removes some old features. Check your code for these:
- Removed modules and functions:
sre_compile,sre_constants, andsre_parse;glob.glob0()andglob.glob1();CGIHTTPRequestHandler; andplatform.java_ver(). - Deprecated, removal in 3.17:
typing.ByteString,collections.abc.ByteString, and the-b/-bbcommand-line options. - File encoding: code that relied on a system-dependent default encoding may behave differently.
The full list is in the Removed, Deprecated, and Porting sections of the official What’s New page.
Should you upgrade?
- Install 3.15.1 and update pip in your virtual environments.
- Check your file-reading code for missing
encodingarguments. - Try
lazyimports if your app starts slowly. - Test the JIT yourself before trusting it.
- Scan the removals list above for anything your project uses.
Try it for fun
Barry Warsaw made a small terminal game with 18 puzzles that teach the new features. Run it with:
uvx --python 3.15 whatsnewtFinal thoughts
Python 3.15 is a practical release. Your apps can start faster, text handling is more predictable, and you get better tools for finding slow code.
Which feature will you try first: lazy imports, frozendict, or Tachyon?
#Python #Python315 #Programming #SoftwareDevelopment #OpenSource
Sources: Python 3.15.1 release page · What’s New in Python 3.15 · Python 3.15.0 release announcement










