This article explains the new features in Python 3.11, compared to 3.10.
Note Prerelease users should be aware that this document is currently in draft form. It will be updated substantially as Python 3.11 moves towards release, so it’s worth checking back even after reading earlier versions.
Optimizations
Compiler optimizes now simple C-style formatting with literal format containing only format codes %s, %r and %a and makes it as fast as corresponding f-string expression. (Contributed by Serhiy Storchaka in bpo-28307.)
“Zero-cost” exceptions are implemented. The cost of try statements is almost eliminated when no exception is raised. (Contributed by Mark Shannon in bpo-40222.)
Porting to Python 3.11
This section lists previously described changes and other bugfixes that may require changes to your code.
PyFrame_BlockSetup() and PyFrame_BlockPop() have been removed. (Contributed by Mark Shannon in bpo-40222.)
Deprecate the following functions to configure the Python initialization:
PySys_AddWarnOptionUnicode()
PySys_AddWarnOption()
PySys_AddXOption()
PySys_HasWarnOptions()
Py_SetPath()
Py_SetProgramName()
Py_SetPythonHome()
Py_SetStandardStreamEncoding()
_Py_SetProgramFullPath()
Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587). (Contributed by Victor Stinner in bpo-44113.)
Post a Comment
If you have any doubts. Please Let me Know