Test Automation

Python Release Notes 2026: What Python 3.15 Means for Testers

Python release notes for 3.15: lazy imports, frozendict, sentinel, UTF-8 by default, unpacking in comprehensions and the Tachyon profiler, explained for testers with code run on Python 3.15.2.

14 min read
Python Release Notes 2026: What Python 3.15 Means for Testers
What You Will Learn
Python Release Notes in Brief
The Python 3.15 Release Cycle at a Glance
Python Release Notes for 3.15: The Five Features I Use First
More Python 3.15 Changes in the Python Release Notes
⚡ Quick Answer
Python 3.15.2, released October 25, 2026, introduces significant features for testers, including explicit lazy imports (PEP 810) that speed up test collection runs by delaying module loading. This release also brings built-in frozendict and sentinel types, UTF-8 as the default encoding, a new Tachyon sampling profiler, and removes old APIs, so QA engineers should upgrade directly to 3.15.2 and review its impact on existing test suites.

Python release notes for 3.15 are the biggest in years. After nine months of alphas, betas and release candidates, Python 3.15.0 shipped in October 2026 with lazy imports, a built-in frozendict, UTF-8 as the default encoding and a new sampling profiler. Two bug-fix releases followed within three weeks. This hub follows the whole 3.15 cycle from a test engineer’s point of view. I built Python 3.15.2 from source and ran every example on it.

Python Release Notes in Brief

The latest Python version is 3.15.2, released October 25, 2026. Python 3.15.0 came out on October 9, 2026, and 3.15.1 followed on October 21. The headline features are explicit lazy imports with the new lazy keyword (PEP 810), the frozendict and sentinel built-in types (PEP 814 and PEP 661), UTF-8 as the default encoding everywhere (PEP 686), * and ** unpacking in comprehensions (PEP 798), and a new profiling package with the Tachyon sampling profiler (PEP 799). Python 3.15 also removes old modules and APIs such as sre_compile, CGIHTTPRequestHandler and typing.ByteString. Python 3.10 reached its scheduled end of life in October 2026, and the first Python 3.16 alpha builds are already out.

The Python 3.15 Release Cycle at a Glance

VersionReleasedStageWhat it meant for testers
3.16.0a2Nov 10, 2026AlphaEarly preview of 3.16; not for real test suites
3.15.2Oct 25, 2026Bug fix77 changes, including 3 security fixes such as a tarfile filter hole
3.14.10 and 3.13.18Oct 25, 2026Bug fixFixes for teams not ready for 3.15
3.15.1Oct 21, 2026Bug fix241 changes, including 3 security fixes and a pip update
3.15.0Oct 9, 2026FinalFirst stable release of Python 3.15
3.10.22Oct 1, 2026Final 3.10 security releasePython 3.10 reaches end of life
3.15.0rc1Aug 4, 2026Release candidateFeature-complete; time to test your suite
3.15.0b4Jul 18, 2026BetaLast beta
3.15.0b2Jun 2, 2026BetaEarly beta for library authors

The quick pair of bug-fix releases after 3.15.0 is normal for a new major version. If you upgrade now, start on 3.15.2, not 3.15.0.

Python Release Notes for 3.15: The Five Features I Use First

Lazy imports (PEP 810)

The new lazy soft keyword delays loading a module until you first use the imported name. You keep every import at the top of the file, but you only pay for the ones a run actually touches. If a lazily imported module fails to load, the error appears where you first use it, and the traceback also shows the original import line.

For test suites this is a real speed-up. A test collection run that imports a large application but runs a few tests no longer has to load every heavy dependency. You can also turn lazy imports on for everything without editing code, using -X lazy_imports=all or PYTHON_LAZY_IMPORTS=all, and sys.set_lazy_imports() changes the mode at runtime.

frozendict (PEP 814)

frozendict is an immutable, hashable mapping. It isn’t a subclass of dict. It preserves insertion order, but two frozendicts with the same items compare equal in any order. json, pickle, copy and pprint all accept it. In tests, it’s a clean way to share configuration objects that no test can change by accident, and to use a configuration as a cache key.

One catch: code that checks isinstance(x, dict) rejects a frozendict. The Python release notes suggest checking for (dict, frozendict) or collections.abc.Mapping instead.

sentinel (PEP 661)

The sentinel built-in creates unique marker values with a readable representation, such as MISSING. Sentinels keep their identity when copied, can be pickled when importable, and work in type hints with |. They replace the old _MISSING = object() pattern, whose repr is an unhelpful <object object at 0x...>.

UTF-8 by default (PEP 686)

open() and other text I/O now default to UTF-8 on every platform, whatever the system locale. This removes a classic cause of tests that pass on Linux and fail on Windows CI. If you depended on the locale encoding, pass encoding="locale" or set PYTHONUTF8=0.

Unpacking in comprehensions (PEP 798)

List, set and dict comprehensions and generator expressions now accept * and **. [*tests for tests in suites] flattens a list of lists without a nested loop or itertools.chain, and {**d for d in dicts} merges a list of dicts.

Python release notes lazy imports loading modules only when they are used
Python release notes lazy imports loading modules only when they are used

More Python 3.15 Changes in the Python Release Notes

These entries in the Python release notes get less attention, but several matter to test and CI work.

  • A profiling package. The new profiling module groups the profilers. profiling.tracing is the deterministic profiler that used to be cProfile, which stays as an alias. profiling.sampling is Tachyon, a low-overhead statistical profiler you can run with python -m profiling.sampling run script.py. The old profile module is deprecated and will be removed in Python 3.17.
  • More color. More command-line tools print colored output, which is easier to read locally. CI logs may need NO_COLOR or PYTHON_COLORS=0 if your log viewer shows escape codes.
  • Startup files (PEP 829). New .start files name a pkg.mod:callable to run at startup, a more auditable alternative to import lines in .pth files.
  • A faster JIT and better errors. The experimental JIT compiler was significantly upgraded, and error messages improved again.
  • Typing. TypedDict can declare typed extra items (PEP 728), TypeForm annotates type expressions (PEP 747), and disjoint bases are part of the type system (PEP 800).
  • Free-threading. Free-threaded builds now have a stable ABI (PEP 803 and related PEPs), and the official macOS installers include free-threading support by default.
  • Observability. Frame pointers are enabled by default (PEP 831), which helps system-level profilers produce accurate stack traces.
  • Windows. The official 64-bit Windows binaries use the tail-calling interpreter.

Removals: What Breaks When You Move to Python 3.15

Every Python release removes APIs deprecated in earlier versions. These are the removals in the 3.15 Python release notes most likely to hit test code and tooling.

RemovedUse instead
sre_compile, sre_constants, sre_parse modulesThe re module
http.server.CGIHTTPRequestHandlerA real web server or WSGI app for test fixtures
typing.ByteString, collections.abc.ByteStringcollections.abc.Buffer, or bytes and bytearray
importlib load_module() methods and zipimporter.load_module()exec_module()
pathlib.PurePath.is_reserved()os.path.isreserved() on Windows
platform.java_ver()No replacement
codeobject.co_lnotabco_lines()
typing.no_type_check_decoratorNo replacement
glob.glob0() and glob.glob1()glob.glob()
wave getmark(), setmark() and getmarkers()No replacement
TypedDict("TD") with no fields argumentTypedDict("TD", {})

Two behavior changes also deserve a test run before you upgrade. AST node constructors now raise TypeError for invalid arguments, which can affect code-generation and linting tools. datetime.strptime() now raises ValueError when the format string contains %d without a year directive, which had been deprecated since 3.13.

Security Fixes in the 3.15.1 and 3.15.2 Python Release Notes

Both bug-fix releases carry three security fixes each. In 3.15.2, tarfile.tar_filter now rejects link members whose path resolves to the destination directory itself, matching data_filter, and http.cookiejar.DefaultCookiePolicy ignores cookies with a negative Version instead of accepting them without a domain check. If your tests or tools extract archives from untrusted sources, these fixes are reason enough to upgrade. The 3.14.10 and 3.13.18 releases on the same day carry the matching fixes for older versions.

Tested Example: Python 3.15 Features in One Script

This script uses five of the headline features from the Python release notes, so you can see them work together. I compiled Python 3.15.2 from the official source tag and ran it. The output below is exactly what it printed.

import sys

lazy import json

MISSING = sentinel("MISSING")


def lookup(config: frozendict, key: str, default=MISSING):
    if key in config:
        return config[key]
    if default is MISSING:
        raise KeyError(key)
    return default


def main() -> None:
    # PEP 810: json is not loaded until first use
    print("json loaded at start:", "json" in sys.modules)
    payload = json.dumps({"ok": True})
    print("json loaded after use:", "json" in sys.modules, payload)

    # PEP 814: frozendict is hashable and immutable
    settings = frozendict(base_url="https://staging.example.com", retries=3)
    cache = {settings: "staging run"}
    print(cache[frozendict(retries=3, base_url="https://staging.example.com")])
    try:
        settings["retries"] = 5
    except TypeError as exc:
        print("immutable:", exc)

    # PEP 661: a named sentinel for "no value given"
    print(lookup(settings, "timeout", default=30), repr(MISSING))

    # PEP 798: unpacking in comprehensions
    suites = [["login", "logout"], ["checkout"], ["search", "filters"]]
    print([*tests for tests in suites])

    # PEP 686: UTF-8 is the default text encoding
    print("utf8 mode:", sys.flags.utf8_mode)


main()
json loaded at start: False
json loaded after use: True {"ok": true}
staging run
immutable: 'frozendict' object does not support item assignment
30 MISSING
['login', 'logout', 'checkout', 'search', 'filters']
utf8 mode: 1

Notice the cache lookup. A frozendict built with its keys in a different order finds the same entry, because equality and hashing ignore order. That makes it a safe dictionary key for test configuration.

I also ran Tachyon on a small CPU-bound script with python -m profiling.sampling run slow.py. It collected about 1,000 samples per second and showed the generator expression taking about 71% of the samples, with no changes to the code.

Four Practical Uses in Test Code

Release notes describe features in general terms. Here is how I would use the Python 3.15 additions in a real test suite.

Lazy imports in conftest.py. A large conftest.py often imports database drivers, cloud SDKs and browser libraries that only some tests need. Marking those imports lazy means a run of five unit tests no longer pays for loading the whole stack. Measure collection time with pytest --collect-only -q before and after, because the gain depends on how heavy your imports are.

frozendict for shared fixtures. Session-scoped fixtures that return configuration are easy to change by accident in one test, which then breaks another test far away. Returning a frozendict turns that silent bug into an immediate TypeError at the line that tried to change it.

UTF-8 for snapshot and fixture files. Snapshot tests, golden files and CSV fixtures read with plain open() now behave the same on Windows and Linux runners. If you have old fixture files saved in a Windows code page, convert them once, or open them with an explicit encoding.

Tachyon for slow tests. When one test is slow and you don’t know why, python -m profiling.sampling can profile a run with very little overhead, so the numbers are closer to what happens in CI than a tracing profiler shows. Point it at a small script that calls the slow code path, as in the example above.

None of this needs a big rewrite. Each item from the Python release notes can be adopted one file at a time once your CI runs on 3.15.

What the Python Release Notes Mean for Your Test Stack

A new Python version only helps if your tools support it. This is where the main test tools stood in November 2026.

Python 3.10 reaching end of life and several tools dropping it in the same year is no coincidence. If any CI image still runs 3.10, move it to 3.12 or later now, and plan 3.15 once your dependencies publish wheels for it.

How I Move a Test Suite to a New Python Version

  1. Run the suite on the release candidate. The rc releases are feature-complete, and they’re the cheapest time to find problems. For 3.16, that will be around August 2027.
  2. Turn on warnings as errors. Run with -W error::DeprecationWarning on the current version first. Most removals in the Python release notes were deprecation warnings for two or more releases.
  3. Check binary wheels. Packages with compiled code, such as database drivers, numpy or lxml, need wheels for the new version before you can install them without a compiler.
  4. Add the new version to the CI matrix. Run it alongside your current version and let it fail without blocking merges until it’s green.
  5. Switch the default. Once the new version passes for a couple of weeks, make it the main version and drop the oldest one.

For a CI matrix example, see the GitHub Actions multi-browser matrix guide, which works the same way for Python versions.

Python 3.15.2 running the demo script

I built Python 3.15.2 from source and ran the demo that covers lazy imports, frozendict, sentinel, comprehension unpacking and UTF-8 mode. The output confirms json is not loaded until first use, and that frozendict refuses item assignment.

Python release notes 3.15 demo run showing lazy import, frozendict and sentinel output
Real output from Python 3.15.2.
Python Release Notes for Software Testers

External Sources

Internal Blog Links

Internal Series Links

People Also Ask About Python Release Notes

What is the latest version of Python?

The latest Python version is 3.15.2, released October 25, 2026. Python 3.15.0, the first stable 3.15 release, came out on October 9, 2026.

What are the biggest new features in Python 3.15?

The biggest features are explicit lazy imports with the lazy keyword, the frozendict and sentinel built-ins, UTF-8 as the default encoding, unpacking in comprehensions, and the new profiling package with the Tachyon sampling profiler.

Is Python 3.10 still supported?

No. Python 3.10 reached its scheduled end of life in October 2026. Its last release was 3.10.22, on October 1, 2026, and it won’t receive further security fixes.

What does lazy import do in Python 3.15?

lazy import module delays loading the module until the name is first used. Python creates a lightweight proxy at import time and loads the real module on first access, which can cut startup time for large applications and test suites.

Is frozendict a subclass of dict?

No. frozendict inherits directly from object, so isinstance(x, dict) returns False for it. Check for (dict, frozendict) or collections.abc.Mapping to accept both.

Does pytest support Python 3.15?

Yes. Pytest added official Python 3.15 support in version 9.1.0, released June 13, 2026. The current pytest 9.2.0 also supports it.

Where can I find the official Python release notes?

The official Python release notes are the “What’s New in Python 3.15” page in the Python documentation, plus the detailed changelog for each bug-fix release. Release announcements appear on python.org and the Python Insider blog.

New to Python for testing? Begin with Learn Python: Zero to Hero, then try data-driven API testing with pytest. For help moving a test suite to a new Python version, see automation testing services.


About the author: Muhammad Shahnawaz Khan is an independent software engineer and applied ML researcher with 11+ years in SDET and SQA. He founded QAPulse by SK and writes about test automation, CI/CD and AI in testing. More about Shahnawaz

Every version and feature on this page comes from the official Python release notes and PEPs. The demo script was run on Python 3.15.2. This page was drafted and reviewed by the author. See our editorial policy.

Frequently Asked Questions

What are the headline features of Python 3.15 for testers?
Python 3.15 introduces explicit lazy imports, frozendict and sentinel built-in types, and UTF-8 as the default encoding everywhere. It also includes a new profiling package with the Tachyon sampling profiler. Testers should note that Python 3.15 removes old modules and APIs like sre_compile and typing.ByteString.
Which Python 3.15 version should QA engineers upgrade to?
If you are upgrading now, QA engineers should start with Python 3.15.2, not 3.15.0. Python 3.15.2, released October 25, 2026, includes 77 changes, with 3 security fixes.
How do lazy imports benefit test suites in Python 3.15?
Lazy imports delay loading a module until an imported name is first used, which can provide a real speed-up for test collection runs that import large applications but execute few tests. This feature can be turned on globally without code changes using -X lazy_imports=all or PYTHON_LAZY_IMPORTS=all.
Need this built for your team?

I build production-grade QA automation for teams that can’t afford to ship bugs.

Playwright, Python, AI testing — 11+ years in software, clients worldwide. Free 30-min call. No commitment.

Book a free call → See services
Found this helpful? Clap to let Shahnawaz know — you can clap up to 50 times.