.Python 3.12 available in RHEL 9
RHEL 9.4 introduces Python 3.12, provided by the new package `python3.12` and a suite of packages built for it, as well as the `ubi9/python-312` container image.
Notable enhancements compared to the previously released Python 3.11 include:
* Python introduces a new `type` statement and new type parameter syntax for generic classes and functions.
* Formatted string literal (f-strings) have been formalized in the grammar and can now be integrated into the parser directly.
* Python now provides a unique per-interpreter global interpreter lock (GIL).
* You can now use the buffer protocol from Python code.
* To improve security, the builtin `hashlib` implementations of the SHA1, SHA3, SHA2-384, SHA2-512, and MD5 cryptographic algorithms have been replaced with formally verified code from the HACL* project. The builtin implementations remain available as fallback if OpenSSL does not provide them.
* Dictionary, list, and set comprehensions in `CPython` are now inlined. This significantly increases the speed of a comprehension execution.
* `CPython` now supports the Linux `perf` profiler.
* `CPython` now provides stack overflow protection on supported platforms.
Python 3.12 and packages built for it can be installed in parallel with Python 3.9 and Python 3.11 on the same system.
To install packages from the `python3.12` stack, use, for example:
[literal]
----
# dnf install python3.12
# dnf install python3.12-pip
----
To run the interpreter, use, for example:
[literal]
----
$ python3.12
$ python3.12 -m pip --help
----
See link:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/installing_and_using_dynamic_programming_languages/assembly_installing-and-using-python_installing-and-using-dynamic-programming-languages[Installing and using Python] for more information.
For information about the length of support of Python 3.12, see link:
https://access.redhat.com/support/policy/updates/rhel-app-streams-life-cycle[Red Hat Enterprise Linux Application Streams Life Cycle].