devnotes.

What's New in Modern Python (3.10 to 3.13)

Python's yearly release cycle (one new minor version each October) has delivered substantial improvements to both syntax and raw performance over the last few releases.

# Python 3.10 — match statement (covered earlier), better error messages,
# and the X | Y union syntax
def area(shape: dict) -> float | None:
    match shape:
        case {"type": "circle", "radius": r}:
            return 3.14159 * r ** 2
        case {"type": "square", "side": s}:
            return s ** 2
        case _:
            return None

# Python 3.11 — up to 60% faster than 3.10 for many workloads (no code changes needed),
# plus exception groups for handling multiple errors at once
try:
    raise ExceptionGroup("multiple failures", [ValueError("bad value"), TypeError("bad type")])
except* ValueError as eg:            # except* handles one exception type from the group
    print("Caught a ValueError:", eg.exceptions)

# Python 3.12 — new generic syntax (covered earlier), more descriptive error messages
def first[T](items: list[T]) -> T:
    return items[0]

# Python 3.13 — experimental free-threaded build (PEP 703, disabling the GIL optionally),
# a much-improved interactive REPL with color and multi-line editing support

Python 3.11 was a landmark performance release — 10-60% faster than 3.10 across various benchmarks, achieved through internal interpreter optimizations, with zero code changes required to benefit; it also introduced exception groups (ExceptionGroup, except*) for cleanly handling multiple unrelated errors raised together, common in concurrent code where several tasks might each fail independently.

Python 3.12 brought the cleaner generic syntax covered in the typing lesson, plus significantly more helpful error messages (pointing more precisely at the actual source of a mistake) and further interpreter performance work.

Python 3.13 (2024) introduced an experimental free-threaded build option that can disable the GIL entirely (still experimental and not the default), which — if it matures and stabilizes — could fundamentally change how CPU-bound multithreading works in Python; it also shipped a substantially improved interactive REPL with syntax highlighting and better multi-line editing.

Keeping up with each release's changelog (at docs.python.org) is worthwhile specifically because Python's improvements have increasingly focused on both making code more expressive (match, generics, the | union syntax) and simply making existing code run faster with no changes required — a rare and valuable combination.

What's New in Python 3.10 to 3.13 | DevNotes