Python 3.9 Release History

Python 3.9 (released October 5, 2020) introduced major internal improvements and laid the groundwork for future language features.

Major Highlight: PEG Parser

One of the most important changes is the switch to a PEG parser (PEP 617).

Performance remains similar, but extensibility is significantly improved :contentReference[oaicite:6]{index=6}

Dict Union Operators (| and |=)

PEP 584 introduced intuitive dictionary merging:

x = {"a": 1}
y = {"a": 2, "b": 3}

z = x | y
# {'a': 2, 'b': 3}

New String Methods

PEP 616:

Safer and more predictable than using .strip() ([Python documentation][1])

Built-in Generic Types

PEP 585:

def func(data: list[str]): ...

Standard Library

Performance Improvements

Deprecations

Subversions log


Official 3.9 documentation