Even though I’ve used Python programming language on-and-off since about year 2000, I only started paying more attention to specific Python versions around 2016 when I gradually started using Python more seriously in devops. When dealing with different runtime environments it is crucial to know which features are available in which Python versions. This page lists the most important features and changes in Python versions for me, to be constantly updated when need arises.
This list below is merely a short sample of all the important or interesting changes in the Python versions. Be sure to check the linked full “What’s New” pages when planning your own workflows and deployments.
Note that I haven’t included any performance improvements in this list since it’s expected that newer Python releases are faster than previous ones anyway, as drafted out by Mark Shannon in Faster CPython plan.
Python 3.13 (released on 2024-10-07)
- What’s New In Python 3.13
- Added
deprecated
argument inargparse.ArgumentParser.add_argument()
base64.z85encode()
and.z85decode()
ipaddress.IPv4Address.ipv6_mapped
propertypathlib.Path.from_uri()
- Improved resolution of
time.monotonic()
andtime.time()
on Windows - Soft deprecated
getopt
andoptparse
modules - Deprecated positional arguments
maxsplit
,count
andflags
inre.split()
,re.sub()
andre.subn()
, they will become keyword-only - Removed “dead batteries“
Python 3.12 (released on 2023-10-02)
- What’s New In Python 3.12
- Python 3.12 is currently the latest Python version available in AWS Lambda (without using custom runtimes, see Lambda runtimes)
- Python 3.12 is available packaged in Ubuntu 24.04 LTS (noble)
itertools.batched()
pathlib.Path.walk()
- Removed
distutils
module - Removed many deprecated
unittest.TestCase
method aliases - Removed some deprecated
configparser
names - Deprecated
datetime.datetime.utcnow()
anddatetime.datetime.utcfromtimestamp()
- Deprecated
sqlite3
default adapters and converters
Python 3.11 (released on 2022-10-24)
- What’s New In Python 3.11
- Python 3.11 is the packaged Python in Debian 12 Bookworm
- Python 3.11 is currently the latest Python version available in Azure Functions (see Azure Functions runtime versions overview)
- Exception groups and
except*
- Exceptions can have added notes
- TOML configuration file parser:
tomllib
module asyncio.TaskGroup
typing.Self
,typing.LiteralString
enum.StrEnum
,enum.show_flag_values()
- Deprecated a few legacy modules (to be removed in Python 3.13)
- Deprecated
typing.Text
(removal schedule not yet specified)
Python 3.10 (released on 2021-10-04)
- What’s New In Python 3.10
- Python 3.10 is available packaged in Ubuntu 22.04 LTS (jammy)
- Allow writing union types as
X | Y
- Structural pattern matching (
match
–case
statements) typing.TypeAlias
socket.timeout
is now an alias ofTimeoutError
bisect
module functions now havekey
parameter- Deprecated
distutils
module (to be removed in Python 3.12)
Python 3.9 (released on 2020-10-05)
- What’s New In Python 3.9
- Python 3.9 is the packaged Python in Debian 11 Bullseye
- Python 3.9 is available packaged in Ubuntu 20.04 LTS (focal)
- Dictionary merge and update operators (
|
and|=
) - Using built-in types (like
dict
andlist
) in type hinting zoneinfo
modulestr.removeprefix()
andstr.removesuffix()
ipaddress.IPv6Address
supports IPv6 scoped addresses
Python 3.8 (released on 2019-10-14, end of life expected in 2024-10)
- What’s New In Python 3.8
- Python 3.8 is available packaged in Ubuntu 20.04 LTS (focal)
- Walrus operator (
:=
, assignment expressions) - Positional-only parameters
typing.Final
,typing.final
,typing.Literal
Python 3.7 (released on 2018-06-27, end of life since 2023-06-27)
- What’s New In Python 3.7
- Python 3.7 is the packaged Python in Debian 10 Buster
- Python 3.7 was available packaged in Ubuntu 18.04 LTS (bionic)
- Dictionary item ordering is preserved
dataclasses
moduleipaddress.IPv4Network.subnet_of()
,.supernet_of()
(and the same foripaddress.IPv6Network
)
Python 3.6 (released on 2016-12-23, end of life since 2021-12-23)
- What’s New In Python 3.6
- Python 3.6 was available packaged in Ubuntu 18.04 LTS (bionic)
- f-strings (formatted string literals)
- Underscores in numeric literals (for grouping digits)
secrets
moduleenum.auto
See also:
- What’s New In Python (for even older Python versions)
- Status of Python Versions
- Python in Debian