| Release: | |release| |
|---|---|
| Date: | |today| |
This article explains the new features in Python 3.9, compared to 3.8.
For full details, see the :source:`Misc/NEWS` file.
Note
Prerelease users should be aware that this document is currently in draft form. It will be updated substantially as Python 3.9 moves towards release, so it's worth checking back even after reading earlier versions.
- None yet.
In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running.
- Add a new public :c:func:`PyObject_CallNoArgs` function to the C API: call a callable Python object without any arguments. It is the most efficient way to call a callable Python object without any argument. (Contributed by Victor Stinner in :issue:`37194`.)
- Currently :func:`math.factorial` accepts :class:`float` instances with
non-negative integer values (like
5.0). It raises a :exc:`ValueError` for non-integral and negative floats. It is deprecated now. In future Python versions it will raise a :exc:`TypeError` for all floats. (Contributed by Serhiy Storchaka in :issue:`37315`.)
- The C function
PyImport_Cleanup()has been removed. It was documented as: "Empty the module table. For internal use only." (Contributed by Victor Stinner in :issue:`36710`.) _dummy_threadanddummy_threadingmodules have been removed. These modules were deprecated since Python 3.7 which requires threading support. (Contributed by Victor Stinner in :issue:`37312`.)aifc.openfp()alias toaifc.open(),sunau.openfp()alias tosunau.open(), andwave.openfp()alias towave.open()have been removed. They were deprecated since Python 3.7. (Contributed by Victor Stinner in :issue:`37320`.)
This section lists previously described changes and other bugfixes that may require changes to your code.