After a year of development, a new stable version of the interpreted programming language Python 3.13 has been released. The release includes changes to the language itself and its standard library. The most important changes include the use of a new interactive interpreter by default, experimental support for working in free-threaded mode (i.e. with disconnection global interpreter lock) (PEP 703), And JIT compiler (PEP 744).
This release marks the transition to the new Python release cycle (Annual Release Cycle for Python, PEP 602), in connection with the desire to extend the period of "full support" for new releases:
- Python 3.9–3.12 have one and a half years of full support, followed by three and a half years of security patches.
- Python 3.13 and later releases will have two years of full support and three years of security fixes.
Work continues on improving error messages. Tracebacks are now highlighted by default. The built-in locals() function now has certain semantics to change the return mapping (PEP 667), and type parameters (typing.TypeVar, typing.ParamSpec, typing.TypeVarTuple) support default values (PEP 696).
Changes to the standard library include the removal of deprecated APIs and modules (aifc, audioop, cgi, cgitb, chunk, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu, and xdrlib), as well as the usual improvements in user friendliness and correctness. Several modules have been removed from the distribution due to their deprecation in Python 3.11 (PEP 594), including the 2to3 tool and library.
Among the security improvements, it is worth noting that ssl.create_default_context() sets the default flags to ssl.VERIFY_X509_PARTIAL_CHAIN and ssl.VERIFY_X509_STRICT.
Added support for platforms: Apple iOS and Android now officially supported platforms (animal 3) (PEP 730, 738). wasm32-wasi is supported at level animal 2, official support for wasm32-emscripten has been discontinued.
For a more thorough introduction to the new features of the release, please refer to the official documentation (at libraryBy language). Follow the article "Moving to Python 3.13" to update your projects to the new language version. See also changelog.
Source: linux.org.ru
