Skip to content
Tutorials Center
My learning

Topics

Python Reference ยท Practical Pages

Python versions 3.8 to 3.14

A guide to what each Python release from 3.8 to 3.14 added: walrus, match, exception groups, the type statement, t-strings and more, with runnable examples.

Python ships a new minor version every October, and each one is supported for about five years. Reference pages on this site mention a version number whenever a feature is newer than 3.8, so it helps to know roughly what arrived when. This page is a map, not a changelog: it lists the features you are most likely to meet in real code.

Check your own version with python --version, or in code with sys.version_info. Code written for a newer version fails with a SyntaxError on an older one, so a project should state the lowest version it supports, for example in pyproject.toml as requires-python = ">=3.10".

Python
import sys

print(sys.version_info >= (3, 12))

Try it

Python Syntax from 3.8 to 3.11

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Syntax from 3.12 to 3.14

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Release highlights

Version Language and syntax Standard library and runtime
3.8 (2019) Walrus operator :=, positional-only parameters /, f"{x=}" functools.cached_property, math.prod, math.isqrt, typing.Literal, Final, TypedDict and Protocol
3.9 (2020) dict | dict, built-in generics such as list[int], new PEG parser zoneinfo, graphlib, str.removeprefix, str.removesuffix, functools.cache, math.lcm
3.10 (2021) match statement, X | Y unions, parenthesized with items, clearer error messages zip(strict=True), int.bit_count(), key= for bisect, aiter() and anext(), dataclass(slots=True)
3.11 (2022) except* and ExceptionGroup, exception notes, error locations in tracebacks tomllib, asyncio.TaskGroup, enum.StrEnum, typing.Self, much faster interpreter
3.12 (2023) type statement and def f[T] generics, freer f-string syntax itertools.batched, Path.walk(), @override, distutils removed, better sys.monitoring
3.13 (2024) New interactive shell, experimental free-threaded build and JIT copy.replace(), warnings.deprecated, type parameter defaults, many legacy modules removed
3.14 (2025) Template strings t"...", deferred annotation evaluation, except A, B: without parentheses compression.zstd, concurrent.interpreters, annotationlib, officially supported free-threaded builds, uuid.uuid7()

Usage notes

  • Pick a floor and stick to it. Write for the oldest version you support and test on all of them; from __future__ import annotations helps a little with type hints on older versions.
  • Features can be backported by libraries. typing_extensions provides newer typing names on older Pythons, and tomli offers tomllib for versions before 3.11.
  • End-of-life matters. Versions that no longer get security fixes (3.8 and 3.9 at the time of writing) should not be used for new projects.
  • Speed improved steadily. Since 3.11 the interpreter specializes common operations, so upgrading often makes the same code faster with no changes.
  • Deprecations come first. Anything removed was announced with a DeprecationWarning earlier. Run tests with python -W error::DeprecationWarning to find upcoming problems.
  • Details are in the individual pages. Each reference page notes the version that introduced a parameter or behavior.