Python 3.13.0a6

This commit is contained in:
Thomas Wouters 2024-04-09 11:52:31 +02:00
parent 57183241af
commit 57aee2a02c
122 changed files with 1314 additions and 345 deletions

View File

@ -20,10 +20,10 @@
#define PY_MINOR_VERSION 13
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 5
#define PY_RELEASE_SERIAL 6
/* Version as a string */
#define PY_VERSION "3.13.0a5+"
#define PY_VERSION "3.13.0a6"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Tue Mar 12 18:35:04 2024
# Autogenerated by Sphinx on Tue Apr 9 11:53:07 2024
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@ -5221,12 +5221,13 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
'current directory, it is read with "\'utf-8\'" encoding and '
'executed as\n'
'if it had been typed at the debugger prompt. This is '
'particularly\n'
'useful for aliases. If both files exist, the one in the home\n'
'directory is read first and aliases defined there can be '
'overridden by\n'
'the local file.\n'
'if it had been typed at the debugger prompt, with the exception '
'that\n'
'empty lines and lines starting with "#" are ignored. This is\n'
'particularly useful for aliases. If both files exist, the one '
'in the\n'
'home directory is read first and aliases defined there can be\n'
'overridden by the local file.\n'
'\n'
'Changed in version 3.2: ".pdbrc" can now contain commands that\n'
'continue debugging, such as "continue" or "next". Previously, '
@ -8640,32 +8641,36 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n'
'\n'
'The "nonlocal" statement causes the listed identifiers to refer '
'to\n'
'previously bound variables in the nearest enclosing scope '
'excluding\n'
'globals. This is important because the default behavior for '
'binding is\n'
'to search the local namespace first. The statement allows\n'
'encapsulated code to rebind variables outside of the local '
'scope\n'
'besides the global (module) scope.\n'
'When the definition of a function or class is nested (enclosed) '
'within\n'
'the definitions of other functions, its nonlocal scopes are the '
'local\n'
'scopes of the enclosing functions. The "nonlocal" statement '
'causes the\n'
'listed identifiers to refer to names previously bound in '
'nonlocal\n'
'scopes. It allows encapsulated code to rebind such nonlocal\n'
'identifiers. If a name is bound in more than one nonlocal '
'scope, the\n'
'nearest binding is used. If a name is not bound in any nonlocal '
'scope,\n'
'or if there is no nonlocal scope, a "SyntaxError" is raised.\n'
'\n'
'Names listed in a "nonlocal" statement, unlike those listed in '
'a\n'
'"global" statement, must refer to pre-existing bindings in an\n'
'enclosing scope (the scope in which a new binding should be '
'created\n'
'cannot be determined unambiguously).\n'
'\n'
'Names listed in a "nonlocal" statement must not collide with '
'pre-\n'
'existing bindings in the local scope.\n'
'The nonlocal statement applies to the entire scope of a function '
'or\n'
'class body. A "SyntaxError" is raised if a variable is used or\n'
'assigned to prior to its nonlocal declaration in the scope.\n'
'\n'
'See also:\n'
'\n'
' **PEP 3104** - Access to Names in Outer Scopes\n'
' The specification for the "nonlocal" statement.\n',
' The specification for the "nonlocal" statement.\n'
'\n'
'**Programmers note:** "nonlocal" is a directive to the parser '
'and\n'
'applies only to code parsed along with it. See the note for '
'the\n'
'"global" statement.\n',
'numbers': 'Numeric literals\n'
'****************\n'
'\n'
@ -13805,14 +13810,18 @@ topics = {'assert': 'The "assert" statement\n'
'contains\n'
'the numbers 0, 1, …, *n*-1. Item *i* of sequence *a* is selected '
'by\n'
'"a[i]".\n'
'"a[i]". Some sequences, including built-in sequences, interpret\n'
'negative subscripts by adding the sequence length. For example,\n'
'"a[-2]" equals "a[n-2]", the second to last item of sequence a '
'with\n'
'length "n".\n'
'\n'
'Sequences also support slicing: "a[i:j]" selects all items with '
'index\n'
'*k* such that *i* "<=" *k* "<" *j*. When used as an expression, a\n'
'slice is a sequence of the same type. This implies that the index '
'set\n'
'is renumbered so that it starts at 0.\n'
'slice is a sequence of the same type. The comment above about '
'negative\n'
'indexes also applies to negative slice positions.\n'
'\n'
'Some sequences also support “extended slicing” with a third “step”\n'
'parameter: "a[i:j:k]" selects all items of *a* with index *x* where '

1270
Misc/NEWS.d/3.13.0a6.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
Add Android build script and instructions.

View File

@ -1 +0,0 @@
Skip building test modules that must be built as shared under WASI.

View File

@ -1 +0,0 @@
Have WASI builds use WASI SDK 21.

View File

@ -1 +0,0 @@
Add :c:func:`PyObject_GenericHash` function.

View File

@ -1,3 +0,0 @@
Add additional flags to :c:func:`PyLong_AsNativeBytes` and
:c:func:`PyLong_FromNativeBytes` to allow the caller to determine how to handle
edge cases around values that fill the entire buffer.

View File

@ -1,3 +0,0 @@
The ``fcntl``, ``grp``, ``pwd``, ``termios``, ``_statistics`` and
``_testconsole`` C extensions are now built with the :ref:`limited C API
<limited-c-api>`. Patch by Victor Stinner.

View File

@ -1,4 +0,0 @@
Add :c:func:`PyType_GetFullyQualifiedName` function to get the type's fully
qualified name. Equivalent to ``f"{type.__module__}.{type.__qualname__}"``, or
``type.__qualname__`` if ``type.__module__`` is not a string or is equal to
``"builtins"``. Patch by Victor Stinner.

View File

@ -1,3 +0,0 @@
Add :c:func:`PyType_GetModuleName` function to get the type's module name.
Equivalent to getting the ``type.__module__`` attribute. Patch by Eric Snow
and Victor Stinner.

View File

@ -1,4 +0,0 @@
Add support for ``%T``, ``%T#``, ``%N`` and ``%N#`` formats to
:c:func:`PyUnicode_FromFormat`: format the fully qualified name of an object
type and of a type: call :c:func:`PyType_GetModuleName`. See :pep:`737` for
more information. Patch by Victor Stinner.

View File

@ -1,3 +0,0 @@
Add :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` functions to
get constants. For example, ``Py_GetConstant(Py_CONSTANT_ZERO)`` returns a
:term:`strong reference` to the constant zero. Patch by Victor Stinner.

View File

@ -1,5 +0,0 @@
In the limited C API version 3.13, getting ``Py_None``, ``Py_False``,
``Py_True``, ``Py_Ellipsis`` and ``Py_NotImplemented`` singletons is now
implemented as function calls at the stable ABI level to hide implementation
details. Getting these constants still return borrowed references. Patch by
Victor Stinner.

View File

@ -1,2 +0,0 @@
Restore removed private ``_PyErr_ChainExceptions1()`` function. Patch by
Victor Stinner.

View File

@ -1,2 +0,0 @@
Add :c:func:`PyType_GetModuleByDef` to the limited C API. Patch by Victor
Stinner.

View File

@ -1,2 +0,0 @@
Make the C API compatible with ``-Werror=declaration-after-statement``
compiler flag again. Patch by Victor Stinner.

View File

@ -1,2 +0,0 @@
Add ``test_cext`` test: build a C extension to check if the Python C API
emits C compiler warnings. Patch by Victor Stinner.

View File

@ -1,3 +0,0 @@
:c:func:`!PyCode_GetFirstFree` is an ustable API now and has been renamed to
:c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan Romanyuk in
:gh:`115781`)

View File

@ -1,2 +0,0 @@
Fix integer overflow in :c:func:`PyLong_AsPid` on non-Windows 64-bit
platforms.

View File

@ -1,3 +0,0 @@
:c:func:`_PyBytes_Resize` can now be called for bytes objects with reference
count > 1, including 1-byte bytes objects. It creates a new bytes object and
destroys the old one if it has reference count > 1.

View File

@ -1 +0,0 @@
Fix :pep:`737` implementation for ``%#T`` and ``%#N``.

View File

@ -1,2 +0,0 @@
Improve the :exc:`SyntaxError` that happens when 'not' appears after an
operator. Patch by Pablo Galindo

View File

@ -1 +0,0 @@
Mime type ``text/rtf`` is now supported by :mod:`mimetypes`.

View File

@ -1,3 +0,0 @@
Dataclasses now calls :func:`exec` once per dataclass, instead of once
per method being added. This can speed up dataclass creation by up to
20%.

View File

@ -1,12 +0,0 @@
Implement an incremental cyclic garbage collector. By collecting the old
generation in increments, there is no need for a full heap scan. This can
hugely reduce maximum pause time for programs with large heaps.
Reduce the number of generations from three to two. The old generation is
split into two spaces, "visited" and "pending".
Collection happens in two steps::
* An increment is formed from the young generation and a small part of the pending space.
* This increment is scanned and the survivors moved to the end of the visited space.
When the collecting space becomes empty, the two spaces are swapped.

View File

@ -1,4 +0,0 @@
The array of values, the ``PyDictValues`` struct is now embedded in the
object during allocation. This provides better performance in the common
case, and does not degrade as much when the object's ``__dict__`` is
materialized.

View File

@ -1,3 +0,0 @@
Compiler populates the new ``__static_attributes__`` field on a class with
the names of attributes of this class which are accessed through self.X from
any function in its body.

View File

@ -1,2 +0,0 @@
Added a Loader that can discover extension modules in an iOS-style Frameworks
folder.

View File

@ -1 +0,0 @@
``list.sort()`` now exploits more cases of partial ordering, particularly those with long descending runs with sub-runs of equal values. Those are recognized as single runs now (previously, each block of repeated values caused a new run to be created).

View File

@ -1 +0,0 @@
Ensure ``INSTRUMENTED_CALL_FUNCTION_EX`` always emits :monitoring-event:`CALL`

View File

@ -1,2 +0,0 @@
Starting new threads and process creation through :func:`os.fork` are now
only prevented once all non-daemon threads exit.

View File

@ -1 +0,0 @@
For ``INSTRUMENTED_CALL_FUNCTION_EX``, set ``arg0`` to ``sys.monitoring.MISSING`` instead of ``None`` for :monitoring-event:`CALL` event.

View File

@ -1 +0,0 @@
Make :func:`os.path.isdevdrive` available on all platforms. For those that do not offer Dev Drives, it will always return ``False``.

View File

@ -1,3 +0,0 @@
The cycle GC now chooses the size of increments based on the total heap
size, instead of the rate of object creation. This ensures that it can keep
up with growing heaps.

View File

@ -1,3 +0,0 @@
Change the old space bit of objects in the young generation from 0 to
gcstate->visited, so that any objects created during GC will have the old
bit set correctly if they get moved into the old generation.

View File

@ -1,6 +0,0 @@
Updated the :mod:`hashlib` built-in `HACL\* project`_ C code from upstream
that we use for many implementations when they are not present via OpenSSL
in a given build. This also avoids the rare potential for a C symbol name
one definition rule linking issue.
.. _HACL\* project: https://github.com/hacl-star/hacl-star

View File

@ -1,2 +0,0 @@
Fix crashes for certain user-created subclasses of :class:`ast.AST`. Such
classes are now expected to set the ``_field_types`` attribute.

View File

@ -1 +0,0 @@
Raise TypeError for non-sequences for :func:`ntpath.commonpath`.

View File

@ -1 +0,0 @@
Optimise several functions in :mod:`os.path`.

View File

@ -1 +0,0 @@
Fix error message for :func:`ntpath.commonpath`.

View File

@ -1,2 +0,0 @@
Added handle of incorrect star expressions, e.g ``f(3, *)``. Patch by
Grigoryev Semyon

View File

@ -1 +0,0 @@
Move ``PyFutureFeatures`` to an internal header and make it private.

View File

@ -1,10 +0,0 @@
Improve the performance of the following :class:`str` methods
by adapting them to the :c:macro:`METH_FASTCALL` calling convention:
* :meth:`~str.count`
* :meth:`~str.endswith`
* :meth:`~str.find`
* :meth:`~str.index`
* :meth:`~str.rfind`
* :meth:`~str.rindex`
* :meth:`~str.startswith`

View File

@ -1,6 +0,0 @@
Improve the performance of the following :class:`bytes` and
:class:`bytearray` methods by adapting them to the :c:macro:`METH_FASTCALL`
calling convention:
* :meth:`!endswith`
* :meth:`!startswith`

View File

@ -1,11 +0,0 @@
Introduce a unified 16-bit backoff counter type (``_Py_BackoffCounter``),
shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The
API used for adaptive specialization counters is changed but the behavior is
(supposed to be) identical.
The behavior of the Tier 2 counters is changed:
* There are no longer dynamic thresholds (we never varied these).
* All counters now use the same exponential backoff.
* The counter for ``JUMP_BACKWARD`` starts counting down from 16.
* The ``temperature`` in side exits starts counting down from 64.

View File

@ -1 +0,0 @@
Refactored the instruction sequence data structure out of compile.c into instruction_sequence.c.

View File

@ -1 +0,0 @@
Raise :exc:`TypeError` for non-paths in :func:`posixpath.relpath()`.

View File

@ -1 +0,0 @@
Speedup :func:`os.path.join` by up to 6% on Windows.

View File

@ -1 +0,0 @@
Changes to documentation files and config outputs to reflect the new location for reporting bugs - i.e. GitHub rather than bugs.python.org.

View File

@ -1 +0,0 @@
Add an iOS platform guide, and flag modules not available on iOS.

View File

@ -1 +0,0 @@
Remove compatibilty references to Emscripten.

View File

@ -1,3 +0,0 @@
:meth:`unittest.TestLoader.discover` now saves the original value of
``unittest.TestLoader._top_level_dir`` and restores it at the end of the
call.

View File

@ -1,4 +0,0 @@
Make :func:`mimetypes.guess_type` properly parsing of URLs with only a host
name, URLs containing fragment or query, and filenames with only a UNC
sharepoint on Windows.
Based on patch by Dong-hee Na.

View File

@ -1,2 +0,0 @@
Accept an iterable of separators in :meth:`asyncio.StreamReader.readuntil`, stopping
when one of them is encountered.

View File

@ -1,3 +0,0 @@
:func:`inspect.getsource` (and related functions) work with
empty module files, returning ``'\n'`` (or reasonable equivalent)
instead of raising ``OSError``. Patch by Kernc.

View File

@ -1,5 +0,0 @@
:func:`asyncio.as_completed` now returns an object that is both an asynchronous
iterator and plain iterator. The new asynchronous iteration pattern allows for
easier correlation between prior tasks and their completed results. This is
a closer match to :func:`concurrent.futures.as_completed`'s iteration pattern.
Patch by Justin Arthur.

View File

@ -1 +0,0 @@
The :mod:`zipimport` module can now read ZIP64 files.

View File

@ -1,2 +0,0 @@
Add :py:class:`asyncio.Queue` termination with
:py:meth:`~asyncio.Queue.shutdown` method.

View File

@ -1 +0,0 @@
Fixed ``_get_slots`` bug which caused error when defining dataclasses with slots and a weakref_slot.

View File

@ -1 +0,0 @@
Make completion of :mod:`pdb` similar to Python REPL

View File

@ -1 +0,0 @@
:mod:`pdb` now allows CLI arguments to ``pdb -m``.

View File

@ -1,2 +0,0 @@
Changes Unicode codecs to return UnicodeEncodeError or UnicodeDecodeError,
rather than just UnicodeError.

View File

@ -1,3 +0,0 @@
Add :meth:`asyncio.Server.close_clients` and
:meth:`asyncio.Server.abort_clients` methods which allow to more forcefully
close an asyncio server.

View File

@ -1,7 +0,0 @@
Fix a race in ``threading.Thread.join()``.
``threading._MainThread`` now always represents the main thread of the main
interpreter.
``PyThreadState.on_delete`` and ``PyThreadState.on_delete_data`` have been
removed.

View File

@ -1 +0,0 @@
Speed up :func:`os.path.realpath` on non-Windows platforms.

View File

@ -1,2 +0,0 @@
Fix the :mod:`ssl` module error handling of connection terminate by peer.
It now throws an OSError with the appropriate error code instead of an EOFError.

View File

@ -1,4 +0,0 @@
Remove some internal protected parts from :mod:`uuid`:
``_has_uuid_generate_time_safe``, ``_netbios_getnode``,
``_ipconfig_getnode``, and ``_load_system_functions``.
They were unused.

View File

@ -1,3 +0,0 @@
Fix support of *interval* values > 1 in
:class:`logging.TimedRotatingFileHandler` for ``when='MIDNIGHT'`` and
``when='Wx'``.

View File

@ -1 +0,0 @@
Implement :func:`ctypes.util.find_library` on Android.

View File

@ -1,2 +0,0 @@
Fix blocking :func:`os.fwalk` and :func:`shutil.rmtree` on opening named
pipe.

View File

@ -1,3 +0,0 @@
In :mod:`ctypes`, ctype data is now stored in type objects directly rather
than in a dict subclass. This is an internal change that should not affect
usage.

View File

@ -1,3 +0,0 @@
Change automatically generated :class:`tkinter.Checkbutton` widget names to
avoid collisions with automatically generated
:class:`tkinter.ttk.Checkbutton` widget names within the same parent widget.

View File

@ -1,10 +0,0 @@
The :mod:`importlib.resources` functions
:func:`~importlib.resources.is_resource()`,
:func:`~importlib.resources.open_binary()`,
:func:`~importlib.resources.open_text()`,
:func:`~importlib.resources.path()`,
:func:`~importlib.resources.read_binary()`, and
:func:`~importlib.resources.read_text()` are un-deprecated, and support
subdirectories via multiple positional arguments.
The :func:`~importlib.resources.contents()` function also allows subdirectories,
but remains deprecated.

View File

@ -1,2 +0,0 @@
Added new :func:`math.fma` function, wrapping C99's ``fma()`` operation:
fused multiply-add function. Patch by Mark Dickinson and Victor Stinner.

View File

@ -1,2 +0,0 @@
Add :func:`platform.android_ver`, which provides device and OS information
on Android.

View File

@ -1,2 +0,0 @@
In :mod:`encodings.idna`, any capitalization of the the ACE prefix
(``xn--``) is now acceptable. Patch by Pepijn de Vos and Zackery Spytz.

View File

@ -1,9 +0,0 @@
Fixed various false positives and false negatives in
* :attr:`ipaddress.IPv4Address.is_private` (see these docs for details)
* :attr:`ipaddress.IPv4Address.is_global`
* :attr:`ipaddress.IPv6Address.is_private`
* :attr:`ipaddress.IPv6Address.is_global`
Also in the corresponding :class:`ipaddress.IPv4Network` and :class:`ipaddress.IPv6Network`
attributes.

View File

@ -1 +0,0 @@
Fix recursive child in dataclasses

View File

@ -1,2 +0,0 @@
In ``PathFinder.invalidate_caches``, delegate to
``MetadataPathFinder.invalidate_caches``.

View File

@ -1,4 +0,0 @@
Restore support of ``None`` and other false values in :mod:`urllib.parse`
functions :func:`~urllib.parse.parse_qs` and
:func:`~urllib.parse.parse_qsl`. Also, they now raise a TypeError for
non-zero integers and non-empty sequences.

View File

@ -1,4 +0,0 @@
On Windows, :func:`time.time()` now uses the
``GetSystemTimePreciseAsFileTime()`` clock to have a resolution better than 1
us, instead of the ``GetSystemTimeAsFileTime()`` clock which has a resolution
of 15.6 ms. Patch by Victor Stinner.

View File

@ -1,5 +0,0 @@
Refreshed zipfile._path from `zipp 3.18
<https://zipp.readthedocs.io/en/latest/history.html#v3-18-0>`_, providing
better compatibility for PyPy, better glob performance for deeply nested
zipfiles, and providing internal access to ``CompleteDirs.inject`` for use
in other tests (like importlib.resources).

View File

@ -1 +0,0 @@
Ignore empty lines and comments in ``.pdbrc``

View File

@ -1,2 +0,0 @@
:class:`_io.WindowsConsoleIO` now emit a warning if a boolean value is
passed as a filedescriptor argument.

View File

@ -1,3 +0,0 @@
configparser: Don't leave ConfigParser values in an invalid state (stored as
a list instead of a str) after an earlier read raised DuplicateSectionError
or DuplicateOptionError.

View File

@ -1,3 +0,0 @@
On Windows, :meth:`subprocess.Popen.wait` no longer calls
``WaitForSingleObject()`` with a negative timeout: pass ``0`` ms if the
timeout is negative. Patch by Victor Stinner.

View File

@ -1 +0,0 @@
Modify standard library to allow for iOS platform differences.

View File

@ -1 +0,0 @@
Fixed :func:`inspect.findsource` for class code objects.

View File

@ -1,7 +0,0 @@
Start the deprecation period for the current behavior of
:func:`datetime.datetime.strptime` and :func:`time.strptime` which always
fails to parse a date string with a :exc:`ValueError` involving a day of
month such as ``strptime("02-29", "%m-%d")`` when a year is **not**
specified and the date happen to be February 29th. This should help avoid
users finding new bugs every four years due to a natural mistaken assumption
about the API when parsing partial date values.

View File

@ -1,2 +0,0 @@
Deferred select imports in importlib.metadata and importlib.resources for a
14% speedup.

View File

@ -1 +0,0 @@
Fix a bug that prevents subclasses of :class:`typing.Any` to be instantiated with arguments. Patch by Chris Fu.

View File

@ -1,2 +0,0 @@
Fix :mod:`zipfile` extraction for directory entries with the name containing
backslashes on Windows.

View File

@ -1,2 +0,0 @@
Lazy-loading of modules that modify their own ``__class__`` no longer
reverts the ``__class__`` to :class:`types.ModuleType`.

View File

@ -1 +0,0 @@
Fix :mod:`dis` module's handling of ``ENTER_EXECUTOR`` instructions.

View File

@ -1,2 +0,0 @@
Fix regression in lazy loading of self-referential modules, introduced in
gh-114781.

View File

@ -1 +0,0 @@
Speed up :func:`compileall.compile_dir` by 20% when using multiprocessing by increasing ``chunksize``.

View File

@ -1,2 +0,0 @@
doctest: only print "and X failed" when non-zero, don't pluralise "1 items".
Patch by Hugo van Kemenade.

View File

@ -1,2 +0,0 @@
In :mod:`subprocess`, raise a more informative message when
``stdout=STDOUT``.

View File

@ -1,2 +0,0 @@
A ``DocTestCase`` now reports as skipped if all examples in the doctest are
skipped.

Some files were not shown because too many files have changed in this diff Show More