Skip to content

Latest commit

 

History

History
949 lines (669 loc) · 19.6 KB

3.9.0a4.rst

File metadata and controls

949 lines (669 loc) · 19.6 KB

Add audit events to functions in fcntl, msvcrt, os, resource, shutil, signal and syslog.

Avoid unsafe DLL load at startup on Windows 7 and earlier.

Add audit events to command execution functions in os and pty modules.

Fix a use-after-free in the single inheritance path of issubclass(), when the __bases__ of an object has a single reference, and so does its first item. Patch by Yonatan Goldschmidt.

Update clinic tool to use :c:func:`Py_IS_TYPE`. Patch by Dong-hee Na.

Enable use of :func:`os.chroot` on HP-UX systems.

Add :c:func:`Py_IS_TYPE` static inline function to check whether the object o type is type.

Fix regression caused by fix for bpo-39386, that prevented calling aclose on an async generator that had already been closed or exhausted.

Change the ending column offset of Attribute nodes constructed in ast_for_dotted_name to point at the end of the current node and not at the end of the last NAME node.

Port _crypt extension module to multiphase initialization (PEP 489).

Port _contextvars extension module to multiphase initialization (PEP 489).

Fix segfault in readinto() method on closed BufferedReader.

Fix :func:`time.localtime` on 64-bit AIX to support years before 1902 and after 2038. Patch by M Felt.

Fix a reference cycle in the C Pickler that was preventing the garbage collection of deleted, pickled objects.

Fixed a possible crash in :meth:`list.__contains__` when a list is changed during comparing items. Patch by Dong-hee Na.

:term:`floor division` of float operation now has a better performance. Also the message of :exc:`ZeroDivisionError` for this operation is updated. Patch by Dong-hee Na.

Port _codecs extension module to multiphase initialization (PEP 489).

Port _bz2 extension module to multiphase initialization (PEP 489).

Port _abc extension module to multiphase initialization (PEP 489).

Replace two complex bytecodes for building dicts with two simpler ones. The new bytecodes DICT_MERGE and DICT_UPDATE have been added The old bytecodes BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL have been removed.

Syntax errors raised in the tokenizer now always set correct "text" and "offset" attributes.

Drop the GIL during large bytes.join operations. Patch by Bruce Merry.

Fix DTrace build issues on FreeBSD. Patch by David Carlier.

Speed up calls to range() by about 30%, by using the PEP 590 vectorcall calling convention. Patch by Mark Shannon.

:class:`dict` (and :class:`collections.UserDict`) objects now support PEP 584's merge (|) and update (|=) operators. Patch by Brandt Bucher.

Optimized the idiom for assignment a temporary variable in comprehensions. Now for y in [expr] in comprehensions is as fast as a simple assignment y = expr.

Fix :exc:`IndexError` when trying to decode an invalid string with punycode codec.

Remove obsolete check for __args__ in bdb.Bdb.format_stack_entry.

Expanded :func:`math.gcd` and :func:`math.lcm` to handle multiple arguments.

Fix a regression where the C pickle module wouldn't allow unpickling from a file-like object that doesn't expose a readinto() method.

Raise :exc:`io.UnsupportedOperation` in :meth:`io.BufferedReader.truncate` when it is called on a read-only :class:`io.BufferedReader` instance.

Add :func:`math.lcm` function: least common multiple.

Revert "Do not expose abstract collection classes in the collections module" change (bpo-25988). Aliases to ABC like collections.Mapping are kept in Python 3.9 to ease transition from Python 2.7, but will be removed in Python 3.10.

Fix hanging ProcessPoolExcutor on shutdown(wait=False) when a task has failed pickling.

Fixed TypedDict totality check for inherited keys.

Fixed starting position of AST for expressions like (a)(b), (a)[b] and (a).b.

The :mod:`pydoc` and :mod:`trace` modules now use the :mod:`sysconfig` module to get the path to the Python standard library, to support uncommon installation path like /usr/lib64/python3.9/ on Fedora. Patch by Jan Matějek.

Collections.deque now holds strong references during deque.__contains__ and deque.count, fixing crashes.

The distutils bdist_msi command is deprecated in Python 3.9, use bdist_wheel (wheel packages) instead.

Improved performance of zipfile.Path for files with a large number of entries. Also improved performance and fixed minor issue as published with importlib_metadata 1.5.

Fix regression in :class:`fractions.Fraction` if the numerator and/or the denominator is an :class:`int` subclass. The :func:`math.gcd` function is now used to normalize the numerator and denominator. :func:`math.gcd` always return a :class:`int` type. Previously, the GCD type depended on numerator and denominator.

Added audit for :func:`os.walk`, :func:`os.fwalk`, :meth:`pathlib.Path.glob` and :meth:`pathlib.Path.rglob`.

Remove unused, undocumented argument getters from :func:`uuid.getnode`

:func:`sys.audit` is now called only once per call of :func:`glob.glob` and :func:`glob.iglob`.

Fix a regression in :class:`~argparse.ArgumentParser` where allow_abbrev=False was ignored for long options that used a prefix character other than "-".

Striped whitespace from docstring before returning it from :func:`unittest.case.shortDescription`.

A new function resolve_name has been added to the pkgutil module. This resolves a string of the form 'a.b.c.d' or 'a.b:c.d' to an object. In the example, a.b is a package/module and c.d is an object within that package/module reached via recursive attribute access.

The :func:`binascii.crc_hqx` function is no longer deprecated.

Mark typing.IO.closed as a property

Add :data:`typing.Annotated` and include_extras parameter to :func:`typing.get_type_hints` as part of PEP 593. Patch by Till Varoquaux, documentation by Till Varoquaux and Konstantin Kashin.

Fix a bug in :func:`unittest.mock.create_autospec` that would complain about the wrong number of arguments for custom descriptors defined in an extension module returning functions.

Mock fully resets child objects on reset_mock(). Patch by Vegard Stikbakke

Allow AsyncMock to correctly patch static/class methods

Implement PEP-489 algorithm for non-ascii "PyInit_..." symbol names in distutils to make it export the correct init symbol also on Windows.

Omit devmajor and devminor fields for non-device files in :mod:`tarfile` archives, enabling bit-for-bit compatibility with GNU tar(1).

Added a new cancel_futures parameter to :meth:`concurrent.futures.Executor.shutdown` that cancels all pending futures which have not started running, instead of waiting for them to complete before shutting down the executor.

bool(fraction.Fraction) now returns a boolean even if (numerator != 0) does not return a boolean (ex: numpy number).

Remove support for with (await asyncio.lock): and with (yield from asyncio.lock):. The same is correct for asyncio.Condition and asyncio.Semaphore.

Ensure, if wraps is supplied to :class:`unittest.mock.MagicMock`, it is used to calculate return values for the magic methods instead of using the default return values. Patch by Karthikeyan Singaravelan.

inspect.Signature.parameters and inspect.BoundArguments.arguments are now dicts instead of OrderedDicts. Patch contributed by Rémi Lapeyre.

Fix sys.exit() and sys.exit(None) exit code propagation when used in multiprocessing.Process.

  • Add lazycache function to __all__.
  • Use dict.clear to clear the cache.
  • Refactoring getline function and checkcache function.

The language reference now specifies restrictions on class namespaces. Adapted from a patch by Ethan Furman.

Updated documentation of total flag of TypedDict.

In pyclbr doc, update 'class' to 'module' where appropriate and add readmodule comment. Patch by Hakan Çelik.

Clarify refcounting semantics for the following functions: - PyObject_SetItem - PyMapping_SetItemString - PyDict_SetItem - PyDict_SetItemString

Explain that when filling with turtle, overlap regions may be left unfilled.

Update mmap readline method description. The fact that the readline method does update the file position should not be ignored since this might give the impression for the programmer that it doesn't update it.

Include subsection in TOC for PDF version of docs.

Skip tests on non-BMP characters of test_winconsoleio.

Skip test_zipfile.test_add_file_after_2107() if :func:`time.localtime` fails with :exc:`OverflowError`. It is the case on AIX 6.1 for example.

Remove COUNT_ALLOCS special build.

Delete unused code related to SxS manifests.

Honor the Python path when a virtualenv is active on Windows.

Improve the error message when attempting to load a DLL with unresolved dependencies.

:meth:`~pathlib.Path.home()` and :meth:`~pathlib.Path.expanduser()` on Windows now prefer :envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not normally set for regular user accounts. This makes them again behave like :func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in 3.8, see :issue:`36264`.

The build.bat script has additional options for very-quiet output (-q) and very-verbose output (-vv)

Add tests for pyparse find_good_parse_start().

In the font configuration window, remove duplicated font names.

Add remaining configdialog tests for buttons and highlights and keys tabs.

IDLE Settings Cancel button now cancels pending changes

Close an IDLE shell calltip if a :exc:`KeyboardInterrupt` or shell restart occurs. Patch by Zackery Spytz.

Move the bytes_methods.h header file to the internal C API as pycore_bytes_methods.h: it only contains private symbols (prefixed by _Py), except of the PyDoc_STRVAR_shared() macro.

Move the dtoa.h header file to the internal C API as pycore_dtoa.h: it only contains private functions (prefixed by _Py). The :mod:`math` and :mod:`cmath` modules must now be compiled with the Py_BUILD_CORE macro defined.

Add :c:func:`Py_SET_SIZE` function to set the size of an object.

:c:func:`PyUnicode_IsIdentifier` does not call :c:func:`Py_FatalError` anymore if the string is not ready.

Add :c:func:`Py_SET_TYPE` function to set the type of an object.

Add a :c:func:`Py_SET_REFCNT` function to set the reference counter of an object.

Convert :c:func:`PyType_HasFeature`, :c:func:`PyType_Check` and :c:func:`PyType_CheckExact` macros to static inline functions.

In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now defined as aliases to :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` to make their implementation opaque. It avoids to leak implementation details in the limited C API. Exclude the following functions from the limited C API: _Py_NewReference(), _Py_ForgetReference(), _PyTraceMalloc_NewReference() and _Py_GetRefTotal().

Exclude trashcan mechanism from the limited C API: it requires access to PyTypeObject and PyThreadState structure fields, whereas these structures are opaque in the limited C API.

The :c:func:`PyThreadState_Clear` function now calls the :c:member:`PyThreadState.on_delete` callback. Previously, that happened in :c:func:`PyThreadState_Delete`.

Fix to clear the interpreter state only after clearing module globals to guarantee module state access from C Extensions during runtime destruction

The Vectorcall API (PEP 590) was made public, adding the functions PyObject_Vectorcall, PyObject_VectorcallMethod, PyVectorcall_Function, PyObject_CallOneArg, PyObject_CallMethodNoArgs, PyObject_CallMethodOneArg, PyObject_FastCallDict, and the flag Py_TPFLAGS_HAVE_VECTORCALL.