Python 3.10¶
Python 3.10.0 (final) was released on the 4 October 2021. The Features for 3.10 are defined in PEP 619 and a detailed description of the changes can be found in What’s New in Python 3.10.
New syntax features |
Status |
|
Structural Pattern Matching: Specification |
||
Structural Pattern Matching: Motivation and Rationale |
||
Structural Pattern Matching: Tutorial |
||
Parenthesized context managers are now officially allowed |
||
New features in the standard library |
||
Add Optional Length-Checking To zip |
||
Interpreter improvements |
||
Precise line numbers for debugging and other tools |
||
New typing features |
||
Allow writing union types as X | Y |
||
Explicit Type Aliases |
||
Parameter Specification Variables |
||
Important deprecations, removals or restrictions |
||
Require OpenSSL 1.1.1 or newer |
||
Deprecate distutils module. |
Not relevant |
|
Deprecate and prepare for the removal of the wstr member in PyUnicodeObject. |
Not relevant |
|
Remove Py_UNICODE encoder APIs |
Not relevant |
|
Add optional EncodingWarning |
Other Language Changes:
The |
|
The views returned by |
|
PEP 618: The |
|
Builtin and extension functions that take integer arguments no longer accept
|
|
If |
|
Assignment expressions can now be used unparenthesized within set literals and set comprehensions, as well as in sequence indexes (but not slices). |
|
Functions have a new |
|
Two new builtin functions – |
|
Static methods ( |
|
Annotations for complex targets (everything beside |
|
Class and module objects now lazy-create empty annotations dicts on demand.
The annotations dicts are stored in the object’s |
|
Annotations consist of |
|
Usage of unbound variables, |
|
Hashes of NaN values of both |
|
A |
|
|
Changes to built-in modules:
Add missing |
|
The |
|
Add audit hooks for |
|
The hashlib module requires OpenSSL 1.1.1 or newer. |
|
The hashlib module has preliminary support for OpenSSL 3.0.0. |
|
The pure-Python fallback of |
|
Add |
|
Add a new function |
|
Add |
|
Add |
|
Add |
|
The exception |
|
Add option to create MPTCP sockets with |
|
Add |
|
The ssl module requires OpenSSL 1.1.1 or newer. |
|
The ssl module has preliminary support for OpenSSL 3.0.0 and new option
|
|
Deprecated function and use of deprecated constants now result in
a |
|
The ssl module now has more secure default settings. Ciphers without forward
secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits
weak RSA, DH, and ECC keys with less than 112 bits of security.
|
|
The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer officially supported. Python does not block them actively. However OpenSSL build options, distro configurations, vendor patches, and cipher suites may prevent a successful handshake. |
|
Add a timeout parameter to the |
|
The ssl module uses heap-types and multi-phase initialization. |
|
A new verify flag |
|
Add |
|
Add |
|
|
Notes
- 1(1,2,3)
The structural pattern matching feature is discussed in issue #7847.