What’s in which Python
Created 17 May 2022, last updated 3 November 2024
This is a summary of what features appeared in which versions of Python. Items with a star were introduced with a __future__ import.
The Python release cycle is explained in PEP 602. Each release has its own PEP with specific dates, listed here. The Python Developer’s Guide has a page summarizing the release cycles of Python versions.
3.14: expected October 2025 (currently alpha 1)
Full list of 3.14 changes. Release schedule: PEP 745. End-of-life expected October 2030.
3.13: October 7, 2024
Full list of 3.13 changes. Release schedule: PEP 719. End-of-life expected October 2029.
3.12: October 2, 2023
- New type annotation syntax for generic classes and
type
aliases (PEP 695). - More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
- The distutils module has been removed (see PEP 594 and PEP 632).
- Invalid backslash escape sequences in strings now warn with SyntaxWarning.
- Per-interpreter GIL, but only in the C API (PEP 684).
Full list of 3.12 changes. Release schedule: PEP 693. End-of-life expected October 2028.
3.11: October 24, 2022
- 10–60% faster than 3.10
- exact expression error locations
- data class transforms (PEP 681)
- exception groups and notes
- typing: Self (PEP 673), LiteralString (PEP 675), variadic generics (PEP 646)
- new module: tomllib
Full list of 3.11 changes. Release schedule: PEP 664. End-of-life expected October 2027.
3.10: October 4, 2021
- structural pattern matching,
match/case
(PEP 634) - better error messages
- parenthesized context managers
- union types as
X|Y
Full list of 3.10 changes. Release schedule: PEP 619. End-of-life expected October 2026.
3.9: October 5, 2020
- dict union operators
- type hinting generics in standard collections (
list[int]
instead ofList[int]
) - relaxed decorator syntax
- str.removeprefix and str.removesuffix
- new modules: graphlib, zoneinfo
Full list of 3.9 changes. Release schedule: PEP 596. End-of-life expected October 2025.
3.8: October 14, 2019 (EOL October 2024)
- assignment expressions (walrus operator
:=
) - f-string “=” specifier
- positional-only parameters
- typing additions: TypedDict, Literal, Final, and Protocol
- new module: importlib.metadata
Full list of 3.8 changes. Release schedule: PEP 569. End-of-life October 7, 2024.
3.7: June 27, 2018 (EOL June 2023)
- postponed evaluation of type annotations (PEP 563)
async
andawait
are keywords- dataclasses
- dict order is guaranteed
- module __getattr__ and __dir__ (PEP 562)
- new modules: contextvars, importlib.resources
Full list of 3.7 changes. Release schedule: PEP 537. End-of-life June 27, 2023.
3.6: December 23, 2016 (EOL December 2021)
- f-strings
- kwargs and class attributes order is preserved
- dicts happen to be (but are not guaranteed to be) ordered
- underscores in numeric literals
- variable annotations
- new module: secrets
Full list of 3.6 changes. Release schedule: PEP 494. End-of-life December 23, 2021.
3.5: September 13, 2015 (EOL September 2020)
- async and await syntax
- matrix multiplication operator @
- more unpacking generalizations
- The typing module for type hints
- subprocess.run()
- os.scandir()
3.4: March 16, 2014 (EOL March 2019)
- pip is always available, via ensurepip
- asyncio (provisional API)
- enum
- Other stdlib modules: statistics, pathlib, and tracemalloc
3.3: September 29th, 2012 (EOL September 2017)
- yield from
- u”” literals are back
- unittest.mock
- hash randomization
- New flexible string representation
- venv module
- more of import implemented in Python
3.2: February 20th, 2011
- argparse
- concurrent.futures
- __pycache__ directories
- hasattr doesn’t swallow all exceptions
3.1: June 27th, 2009
- OrderedDict and Counter classes
- __main__.py
3.0: December 3rd, 2008
- strings are now unicode, no u”” literals
- print as a function
- iterators instead of lists: range, .keys, .items, .values, zip, map, filter
- nonlocal
- function annotations
- lots of things moved in the standard library
2.7: July 3rd, 2010 (EOL January 2020)
- Set literals syntax
- Dictionary and set comprehensions
- OrderedDict and Counter classes
- argparse
- .format can use bare {} placeholders
2.6: October 1st, 2008 (EOL October 2013)
- str.format()
- 3.0 compatibility: print function *, byte literals, io library
- “except” with “as” keyword
- Stdlib additions: multiprocessing, json, abc, fractions
- Class decorators
2.5: September 19th, 2006
- The “with” statement *
- Conditional expressions
- The functools module
- Unified try/except/finally
- Value passed into generators
- defaultdict
- any(), all(), min(key=) and max(key=)
2.4: November 30th, 2004
- Native set datatype
- Generator expressions
- Function decorators
- string.Template
- reversed()
- The subprocess and decimal modules
2.3: July 29th, 2003
- Set datatype module
- Boolean datatype
- Importing from zip files
- enumerate
- The logging and csv packages
- Extended list slicing
2.2: December 21st, 2001
- New-style classes
- Iterators
- Generators *
- // integer division
- Dividing ints can produce floats *
2.1: April 17th, 2001
- Nested scopes *
- “from __future__”
- Rich comparisons
- Weak references
2.0: October 16th, 2000
- Unicode
- List comprehensions
- String methods
- Augmented assignment
- Cyclic garbage collection