Skip to content

Latest commit

 

History

History
961 lines (677 loc) · 19.2 KB

3.9.0b1.rst

File metadata and controls

961 lines (677 loc) · 19.2 KB

:mod:`uuid` no longer uses :mod:`ctypes` to load :file:`libuuid` or :file:`rpcrt4.dll` at runtime.

Correctly generate annotations where parentheses are omitted but required (e.g: Type[(str, int, *other))].

Fixed :meth:`str.isidentifier` for non-canonicalized strings containing non-BMP characters on Windows.

Improved syntax errors for invalid characters in source code.

Fixed a bug when using :func:`codeop.compile_command` that was causing exceptions to be swallowed with the new parser. Patch by Pablo Galindo

Apply PEP 573 to :mod:`abc`.

Initialize n->n_col_offset. (Patch by Joannah Nanjekye)

Fix command line argument parsing: no longer write errors multiple times into stderr.

Port :mod:`errno` to multiphase initialization (PEP 489).

Add pass-throughs for :func:`hash` and :func:`reversed` to :class:`weakref.proxy` objects. Patch by Pablo Galindo.

Port :mod:`syslog` to multiphase initialization (PEP 489).

Reporting a specialised error message for invalid string prefixes, which was introduced in :issue:`40246`, is being reverted due to backwards compatibility concerns for strings that immediately follow a reserved keyword without whitespace between them. Constructs like bg="#d00" if clear else"#fca" were failing to parse, which is not an acceptable breakage on such short notice.

Fix imp module deprecation warning when PyImport_ReloadModule is called. Patch by Robert Rouhani.

Fixed support of nested type variables in GenericAlias (e.g. list[list[T]]).

Port _stat module to multiphase initialization (PEP 489).

Enable implicit exception chaining when calling :meth:`generator.throw`.

Add tools for generating mappings headers for CJKCodecs.

Setting frame.f_lineno is now robust w.r.t. changes in the source-to-bytecode compiler

Added the ability to list interpreters associated with channel ends in the internal subinterpreters module.

Improve performance of :c:func:`PyLong_FromDouble` for values that fit into :c:expr:`long`.

Fixed :func:`ast.get_source_segment` for ast nodes that have incomplete location information. Patch by Irit Katriel.

Convert :mod:`bisect` to use Argument Clinic.

Added the :func:`~zoneinfo.available_timezones` function to the :mod:`zoneinfo` module. Patch by Paul Ganssle.

The :class:`hmac.HMAC` exposes internal implementation details. The attributes digest_cons, inner, and outer are deprecated and will be removed in the future.

The internal module _hashlib wraps and exposes OpenSSL's HMAC API. The new code will be used in Python 3.10 after the internal implementation details of the pure Python HMAC module are no longer part of the public API.

Builtin hash modules can now be disabled or selectively enabled with configure --with-builtin-hashlib-hashes=sha3,blake1 or --without-builtin-hashlib-hashes.

The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF from OpenSSL when available.

The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2.

Revert changes to :func:`inspect.getdoc`.

When cancelling a task due to timeout, :meth:`asyncio.wait_for` will now propagate the exception if an error happens during cancellation. Patch by Roman Skurikhin.

Fix edge cases in SyntaxError formatting. If the offset is <= 0, no caret is printed. If the offset is > line length, the caret is printed pointing just after the last character.

If text content lines are longer than policy.max_line_length, always use a content-encoding to make sure they are wrapped.

Added functools.cache() as a simpler, more discoverable way to access the unbounded cache variant of lru_cache(maxsize=None).

PEP 615, the :mod:`zoneinfo` module. Adds support for the IANA time zone database.

Removed attributes __args__ and __parameters__ from special generic aliases like typing.List (not subscripted).

Convert posixmodule.c ("posix" or "nt" module) to the multiphase initialization (PEP 489).

Add a msg argument to :meth:`Future.cancel` and :meth:`Task.cancel`.

Added an optional counts parameter to random.sample().

The :mod:`ssl` and :mod:`hashlib` modules now actively check that OpenSSL is build with thread support. Python 3.7.0 made thread support mandatory and no longer works safely with a no-thread builds.

When a :class:`asyncio.Task` is cancelled, the exception traceback now chains all the way back to where the task was first interrupted.

:func:`functools.lru_cache` objects can now be the targets of weakrefs.

Fix possible memory leak in the C implementation of :class:`asyncio.Task`.

fnmatch.fnmatch() could take exponential time in the presence of multiple * pattern characters. This was repaired by generating more elaborate regular expressions to avoid futile backtracking.

:mod:`compileall` is now able to use hardlinks to prevent duplicates in a case when .pyc files for different optimization levels have the same content.

The ssl module now support OpenSSL builds without TLS 1.0 and 1.1 methods.

Improve error reporting in :func:`ast.literal_eval` in the presence of malformed :class:`ast.Dict` nodes instead of silently ignoring any non-conforming elements. Patch by Curtis Bucher.

Deprecated the optional random argument to random.shuffle().

:func:`platform.win32_ver` now produces correct ptype strings instead of empty strings.

The first argument of :func:`pickle.loads` is now positional-only.

Update :mod:`nntplib` to merge :class:`nntplib.NNTP` and :class:`nntplib._NNTPBase`. Patch by Dong-hee Na.

Update :mod:`dbm.gnu` to use gdbm_count if possible when calling :func:`len`. Patch by Dong-hee Na.

Add isolated=True keyword-only parameter to _xxsubinterpreters.create(). An isolated subinterpreter cannot spawn threads, spawn a child process or call os.fork().

Remove _random.Random.randbytes(): the C implementation of randbytes(). Implement the method in Python to ease subclassing: randbytes() now directly reuses getrandbits().

Added default arguments to :meth:`difflib.SequenceMatcher.find_longest_match()`.

Fix a race condition in concurrent.futures._ThreadWakeup: access to _ThreadWakeup is now protected with the shutdown lock.

Process.shutdown(wait=True) of :mod:`concurrent.futures` now closes explicitly the result queue.

Add a new :meth:`~multiprocessing.SimpleQueue.close` method to the :class:`~multiprocessing.SimpleQueue` class to explicitly close the queue.

Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps' set uses default return values for magic methods.

Added files() function to importlib.resources with support for subdirectories in package data, matching backport in importlib_resources 1.5.

:meth:`imaplib.IMAP4.unselect` is added. Patch by Dong-hee Na.

repr() now returns typing.Optional[T] when called for typing.Union of two types, one of which is NoneType.

Add support for CAN_J1939 sockets (available on Linux 5.4+)

:class:`types.MappingProxyType` is now reversible.

The repr for :class:`types.SimpleNamespace` is now insertion ordered rather than alphabetical.

On AIX, :func:`~time.thread_time` is now implemented with thread_cputime() which has nanosecond resolution, rather than clock_gettime(CLOCK_THREAD_CPUTIME_ID) which has a resolution of 10 milliseconds. Patch by Batuhan Taskaya.

Raise TypeError when _generate_next_value_ is defined after members. Patch by Ethan Onstott.

In the argparse module, the repr for Namespace() and other argument holders now displayed in the order attributes were added. Formerly, it displayed in alphabetical order even though argument order is preserved the user visible parts of the module.

The isocalendar() methods of :class:`datetime.date` and :class:`datetime.datetime` now return a :term:`named tuple` instead of a :class:`tuple`.

Add version of removal for explicit passing of coros to asyncio.wait()'s documentation

Provide docstrings for webbrowser open functions.

Mention that :func:`asyncio.wait` requires a non-empty set of awaitables.

Tutorial example for sorted() in the Loop Techniques section is given a better explanation. Also a new example is included to explain sorted()'s basic behavior.

Fix an incorrect signature for :func:`pickle.loads` in the docs

distutils.tests now saves/restores warnings filters to leave them unchanged. Importing tests imports docutils which imports pkg_resources which adds a warnings filter.

test_gdb and test.pythoninfo now check gdb command exit code.

Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling issue.

Add --with-experimental-isolated-subinterpreters build option to configure: better isolate subinterpreters, experimental build mode.

Include winsock2.h in pytime.c for timeval.

Increase reserved stack space to prevent overflow crash on Windows.

Add IPv6 support to :mod:`asyncio` datagram endpoints in ProactorEventLoop. Change the raised exception for unknown address families to ValueError as it's not coming from Windows API.

When building Python on macOS from source, _tkinter now links with non-system Tcl and Tk frameworks if they are installed in /Library/Frameworks, as had been the case on older releases of macOS. If a macOS SDK is explicitly configured, by using --enable-universalsdk= or -isysroot, only the SDK itself is searched. The default behavior can still be overridden with --with-tcltk-includes and --with-tcltk-libs.

Expose RFC 3542 IPv6 socket options.

Update multissltest helper to test with latest OpenSSL 1.0.2, 1.1.0, 1.1.1, and 3.0.0-alpha.

Fix a syntax typo in turtledemo that now raises a SyntaxError.

Fix multissltest tool. OpenSSL has changed download URL for old releases. The multissltest tool now tries to download from current and old download URLs.

Remove the _PyUnicode_ClearStaticStrings() function from the C API.

Add PyCFunction_CheckExact() macro for exact type checks now that we allow subtypes of PyCFunction, as well as PyCMethod_CheckExact() and PyCMethod_Check() for the new PyCMethod subtype.

Declare _PyErr_GetTopmostException() with PyAPI_FUNC() to properly export the function in the C API. The function remains private (_Py) prefix.

Nullify inittab_copy during finalization, preventing future interpreter initializations in an embedded situation from crashing. Patch by Gregory Szorc.

The :c:func:`PyThreadState_GetFrame` function now returns a strong reference to the frame.

Remove the following functions from the C API. Call :c:func:`PyGC_Collect` explicitly to free all free lists.

  • PyAsyncGen_ClearFreeLists()
  • PyContext_ClearFreeList()
  • PyDict_ClearFreeList()
  • PyFloat_ClearFreeList()
  • PyFrame_ClearFreeList()
  • PyList_ClearFreeList()
  • PySet_ClearFreeList()
  • PyTuple_ClearFreeList()

New :c:func:`PyFrame_GetBack` function: get the frame next outer frame.

New :c:func:`PyFrame_GetCode` function: return a borrowed reference to the frame code.

Ensure that instances of types created with :c:func:`PyType_FromSpecWithBases` will visit its class object when traversing references in the garbage collector (implemented as an extension of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by Pablo Galindo.

Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin.