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
| Version | Released | Stage | What it meant for testers |
|---|---|---|---|
| 3.16.0a2 | Nov 10, 2026 | Alpha | Early preview of 3.16; not for real test suites |
| 3.15.2 | Oct 25, 2026 | Bug fix | 77 changes, including 3 security fixes such as a tarfile filter hole |
| 3.14.10 and 3.13.18 | Oct 25, 2026 | Bug fix | Fixes for teams not ready for 3.15 |
| 3.15.1 | Oct 21, 2026 | Bug fix | 241 changes, including 3 security fixes and a pip update |
| 3.15.0 | Oct 9, 2026 | Final | First stable release of Python 3.15 |
| 3.10.22 | Oct 1, 2026 | Final 3.10 security release | Python 3.10 reaches end of life |
| 3.15.0rc1 | Aug 4, 2026 | Release candidate | Feature-complete; time to test your suite |
| 3.15.0b4 | Jul 18, 2026 | Beta | Last beta |
| 3.15.0b2 | Jun 2, 2026 | Beta | Early 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.

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
profilingmodule groups the profilers.profiling.tracingis the deterministic profiler that used to becProfile, which stays as an alias.profiling.samplingis Tachyon, a low-overhead statistical profiler you can run withpython -m profiling.sampling run script.py. The oldprofilemodule 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_COLORorPYTHON_COLORS=0if your log viewer shows escape codes. - Startup files (PEP 829). New
.startfiles name apkg.mod:callableto run at startup, a more auditable alternative toimportlines in.pthfiles. - A faster JIT and better errors. The experimental JIT compiler was significantly upgraded, and error messages improved again.
- Typing.
TypedDictcan declare typed extra items (PEP 728),TypeFormannotates 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.
| Removed | Use instead |
|---|---|
sre_compile, sre_constants, sre_parse modules | The re module |
http.server.CGIHTTPRequestHandler | A real web server or WSGI app for test fixtures |
typing.ByteString, collections.abc.ByteString | collections.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_lnotab | co_lines() |
typing.no_type_check_decorator | No replacement |
glob.glob0() and glob.glob1() | glob.glob() |
wave getmark(), setmark() and getmarkers() | No replacement |
TypedDict("TD") with no fields argument | TypedDict("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: 1Notice 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.
- pytest added official Python 3.15 support in 9.1.0. Use 9.1.0 or later, ideally 9.2.0. See the pytest release notes hub.
- Locust dropped Python 3.10 in 2.46.1, so Python 3.11 or later is required. See the performance testing release notes hub.
- Selenium 4.54.0 supports current Python versions. The examples in the Selenium release notes hub ran on Python 3.13.
- FastAPI dropped Python 3.10 in 0.162.6. See the FastAPI release notes hub.
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
- 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.
- Turn on warnings as errors. Run with
-W error::DeprecationWarningon the current version first. Most removals in the Python release notes were deprecation warnings for two or more releases. - Check binary wheels. Packages with compiled code, such as database drivers,
numpyorlxml, need wheels for the new version before you can install them without a compiler. - 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.
- 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.

External Sources
- What’s New in Python 3.15, Python documentation
- Python 3.15 changelog, Python documentation
- Python downloads, python.org
- Status of Python versions, Python Developer’s Guide
- PEP 810: Explicit lazy imports, Python PEPs
- CPython repository, GitHub
Internal Blog Links
- gRPC & Protocol Buffer Testing with Python & Polyglot
- Build Your First MCP Server in Python: A Production-Ready Guide for Beginners
- Auto-Generating PyTest Suites: 7 Best OpenAPI Secrets
- Playwright MCP Server in Python: 5 Best Setup Secrets
- Testcontainers in Python: 7 Best Database Secrets
Internal Series Links
- Learn Python – Zero to Hero
- Playwright Forge — Modern Web Automation
- Agentic QA & LLMs — AI Driven Quality Engineering
- API & Performance Testing
- Enterprise SDET Architect — Frameworks, CI/CD & Leadership
- LangGraph: Complete Zero to Hero
- Claude Code Tutorial: Complete Zero to Hero
- Learn MCP – Zero to Hero
- Cursor AI: Complete Zero to Hero
- OpenAI Codex: Complete Zero to Hero
- AutoGen: Complete Zero to Hero Guide
- AI Agents for QA: Zero to Hero
- Python for Data Science: Complete Zero to Hero
- Learn Playwright – Zero to Hero
- Learn Cypress Testing – Zero to Hero
- Learn Selenium WebDriver – Zero to Hero
- Postman AI: Complete Zero to Hero
- XCUITest iOS Testing: Complete Zero to Hero
- Appium: Complete Zero to Hero
- Detox React Native Testing: Complete Zero to Hero
- EarlGrey: Complete Zero to Hero
- Espresso Android Testing: Complete Zero to Hero
- Flutter Integration Testing: Complete Zero to Hero
- Maestro Mobile Testing: Complete Zero to Hero
- Robot Framework Appium: Complete Zero to Hero
- UI Automator: Complete Zero to Hero
- WebdriverIO Mobile: Complete Zero to Hero
- SQL Mastery: From Basics to Advanced
- TencentDB Agent Memory: Complete Zero to Hero
- DataRobot: Complete Zero to Hero
- Deepnote AI: Complete Zero to Hero
- Jupyter AI: Complete Zero to Hero
- AWS Q Developer: Complete Zero to Hero
- Azure AI DevOps: Complete Zero to Hero
- Docker AI: Complete Zero to Hero
- GitHub Actions AI: Complete Zero to Hero
- Google Cloud AI: Complete Zero to Hero
- Kubernetes AI: Complete Zero to Hero
- Terraform AI: Complete Zero to Hero
- Free QA Resources Built From Real Experience
- QA Glossary: Test Automation Terms Every Engineer Should Know
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.




