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).
- More flexible than the old LL(1) parser
- Enables future syntax improvements
- Foundation for features like pattern matching (Python 3.10)
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}
- Cleaner than
dict.update()or unpacking - Supports both merge and in-place update ([Python documentation][1])
New String Methods
PEP 616:
str.removeprefix()str.removesuffix()
Safer and more predictable than using .strip() ([Python documentation][1])
Built-in Generic Types
PEP 585:
- Use built-in collections as generics:
def func(data: list[str]): ...
- No need to import from
typing([Python documentation][1])
Standard Library
- New
zoneinfomodule (IANA time zones) - New
graphlibmodule for topological sorting - Improvements across multiple modules ([Python documentation][1])
Performance Improvements
- Faster built-in types (
list,dict, etc.) - Adoption of vectorcall (PEP 590)
- Improved garbage collection and module initialization ([Python documentation][1])
Deprecations
- Old LL(1) parser deprecated
parsermodule deprecated- Ongoing cleanup of legacy APIs
Subversions log
- 3.9.23 (Jul 2025) — final security updates
- 3.9.19 (Mar 2024) — cumulative fixes
- 3.9.10 (Jan 2022) — memory and module fixes
- 3.9.1 (Dec 2020) — Apple Silicon support
- 3.9.0 (Oct 2020) — initial release