Skip to content

Latest commit

 

History

History
745 lines (528 loc) · 15.8 KB

3.12.0a7.rst

File metadata and controls

745 lines (528 loc) · 15.8 KB

Deprecated _PyErr_ChainExceptions in favour of _PyErr_ChainExceptions1.

Reduce the number of inline :opcode:`CACHE` entries for :opcode:`BINARY_SUBSCR`.

Removed :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!JUMP_IF_TRUE_OR_POP` instructions.

Fixed stacktop value on tracing entries to avoid corruption on garbage collection.

Add :data:`sys.last_exc` and deprecate :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback`, which hold the same information in its legacy form.

Replace all occurrences of COMPARE_AND_BRANCH with :opcode:`COMPARE_OP`.

Fix overflow when creating very large dict.

Add :c:func:`PyErr_DisplayException` which takes just an exception instance, to replace the legacy :c:func:`PyErr_Display` which takes the (typ, exc, tb) triplet.

Add note to exception raised in PyErr_SetObject when normalization fails.

Shrink the number of inline :opcode:`CACHE` entries used by :opcode:`LOAD_GLOBAL`.

Improve import time of platform by removing IronPython version parsing. The IronPython version parsing was not functional (see IronLanguages/ironpython3#1667).

Rearrage bits in first field (after header) of PyLongObject. * Bits 0 and 1: 1 - sign. I.e. 0 for positive numbers, 1 for zero and 2 for negative numbers. * Bit 2 reserved (probably for the immortal bit) * Bits 3+ the unsigned size.

This makes a few operations slightly more efficient, and will enable a more compact and faster 2s-complement representation of most ints in future.

Fix segfault from race condition in signal handling during garbage collection. Patch by Kumar Aditya.

:mod:`codecs` encoding/decoding errors now get the context information (which operation and which codecs) attached as PEP 678 notes instead of through chaining a new instance of the exception.

Fix potential nullptr dereference and use of uninitialized memory in fileutils. Patch by Max Bachmann.

Reuse operands with refcount of 1 in float specializations of BINARY_OP.

Fix performance loss when accessing an object's attributes with __getattr__ defined.

Improve build support for the Xbox. Patch by Max Bachmann.

Fix SSE2 and SSE3 detection in _blake2 internal module. Patch by Max Bachmann.

Deprecate co_lnotab in code objects, schedule it for removal in Python 3.14

Adapt :mod:`!_pickle` to PEP 687. Patch by Mohamed Koubaa and Erlend Aasland.

Pure python :func:`locale.getencoding()` will not warn deprecation.

It's no longer possible to register conditional breakpoints in :class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by Tian Gao.

Don't ignore exceptions in member type creation.

Ensure final _generate_next_value_ is a staticmethod.

Display current line label correctly in :mod:`dis` when show_caches is False and lasti points to a CACHE entry.

:func:`isinstance` checks against :func:`runtime-checkable protocols <typing.runtime_checkable>` now use :func:`inspect.getattr_static` rather than :func:`hasattr` to lookup whether attributes exist. This means that descriptors and :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated during isinstance() checks against runtime-checkable protocols. However, it may also mean that some objects which used to be considered instances of a runtime-checkable protocol may no longer be considered instances of that protocol on Python 3.12+, and vice versa. Most users are unlikely to be affected by this change. Patch by Alex Waygood.

It's no longer possible to register expressions to display in :class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by Tian Gao.

Improve traceback when :func:`dataclasses.fields` is called on a non-dataclass. Patch by Alex Waygood

The :class:`asyncio.Timeout` context manager now works reliably even when performing cleanup due to task cancellation. Previously it could raise a :exc:`~asyncio.CancelledError` instead of an :exc:`~asyncio.TimeoutError` in such cases.

Remove support for obsolete browsers from :mod:`webbrowser`. Removed browsers include Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, Firebird, and Firefox versions 35 and below.

Improve performance of :func:`math.log` arguments handling by removing the argument clinic.

Add the onexc arg to :func:`shutil.rmtree`, which is like onerror but expects an exception instance rather than an exc_info tuple. Deprecate onerror.

typing: Fix a bug relating to substitution in custom classes generic over a :class:`~typing.ParamSpec`. Previously, if the ParamSpec was substituted with a parameters list that itself contained a :class:`~typing.TypeVar`, the TypeVar in the parameters list could not be subsequently substituted. This is now fixed.

Patch by Nikita Sobolev.

Fix issue where __new__() and __init__() methods of :class:`pathlib.PurePath` and :class:`~pathlib.Path` subclasses were not called in some circumstances.

:func:`asyncio.wait` now accepts generators yielding tasks. Patch by Kumar Aditya.

:func:`asyncio.iscoroutine` now returns False for generators as :mod:`asyncio` does not support legacy generator-based coroutines. Patch by Kumar Aditya.

Optimized fmean(), correlation(), covariance(), and linear_regression() using the new math.sumprod() function.

Typing: Improve the repr of generic aliases for classes generic over a :class:`~typing.ParamSpec`. (Use square brackets to represent a parameter list.)

:meth:`asyncio.Task.get_coro` now always returns a coroutine when wrapping an awaitable object. Patch by Kumar Aditya.

Speed up setting or deleting mutable attributes on non-dataclass subclasses of frozen dataclasses. Due to the implementation of __setattr__ and __delattr__ for frozen dataclasses, this previously had a time complexity of O(n). It now has a time complexity of O(1).

Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` functions on Windows for enumerating drives, volumes and mount points

Attribute name of the extracted :mod:`tarfile` file object now holds filename of itself rather than of the archive it is contained in. Patch by Oleg Iarygin.

Private helper method inspect._signature_strip_non_python_syntax will no longer strip / from the input string.

Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`. Patch by Thomas Krennwallner.

Add module argument to :func:`dataclasses.make_dataclass` and make classes produced by it pickleable.

Fix __weakref__ descriptor generation for custom dataclasses.

Skip a stat in :mod:`site` if we have already found a pyvenv.cfg

Fix issues when defining dataclasses that have fields with specific underscore names that aren't clearly reserved by :mod:`dataclasses`.

Fix a :mod:`pdb` bug where ll clears the changes to local variables.

Added -h and --help arguments to the webbrowser CLI

:meth:`ssl.SSLContext.load_verify_locations` no longer incorrectly accepts some cases of trailing data when parsing DER.

Fix pathlib.Path.walk RecursionError on deep directory trees by rewriting it using iteration instead of recursion.

Added an optional delete keyword argument to :class:`tempfile.TemporaryDirectory`.

Added --durations command line option, showing the N slowest test cases. :class:`unittest.TextTestRunner` and :class:`unittest.TextTestResult` constructors accept a new durations keyword argument. Subclasses should take this into account or accept **kwargs. Added :meth:`unittest.TestResult.addDuration` method and :attr:`unittest.TestResult.collectedDurations` attribute.

(Contributed by Giampaolo Rodola)

Fix :func:`dataclasses.astuple` crash when :class:`collections.defaultdict` is present in the attributes.

Fix incorrect results from :meth:`ssl.SSLSocket.shared_ciphers`

When built against OpenSSL 3.0, the :mod:`ssl` module had a bug where it reported unauthenticated EOFs (i.e. without close_notify) as a clean TLS-level EOF. It now raises :exc:`~ssl.SSLEOFError`, matching the behavior in previous versions of OpenSSL. The :attr:`~ssl.SSLContext.options` attribute on :class:`~ssl.SSLContext` also no longer includes :const:`~ssl.OP_IGNORE_UNEXPECTED_EOF` by default. This option may be set to specify the previous OpenSSL 3.0 behavior.

Now :func:`uuid.uuid3` and :func:`uuid.uuid5` functions support :class:`bytes` objects as their name argument.

Fix a :mod:`concurrent.futures.process` bug where ProcessPoolExecutor shutdown could hang after a future has been quickly submitted and canceled.

Added deprecation warning to isdst parameter of :func:`email.utils.localtime`.

Fix handling of Windows filenames that resemble drives, such as ./a:b, in :mod:`pathlib`.

Add docstring to :meth:`http.client.HTTPResponse.read` to fix pydoc output.

Improve test coverage on :mod:`pdb`.

Adjust the error handling strategy in test_zoneinfo.TzPathTest.python_tzpath_context. Patch by Paul Ganssle.

Improved test_locale_calendar_formatweekday of calendar.

Add a dev container (along with accompanying Dockerfile) for development purposes.

Fix -Wstrict-prototypes compiler warnings.

Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet Explorer.

Improves correctness of stat results for Windows, and uses faster API when available

Misc/gdbinit was removed.

Add a new (unstable) C-API function for iterating over GC'able objects using a callback: PyUnstable_VisitObjects.