Python 3.13.0a2

This commit is contained in:
Thomas Wouters 2023-11-22 11:43:55 +01:00
parent ad0e2a9332
commit 9c4347ef8b
156 changed files with 1651 additions and 403 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 1
#define PY_RELEASE_SERIAL 2
/* Version as a string */
#define PY_VERSION "3.13.0a1+"
#define PY_VERSION "3.13.0a2"
/*--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 Fri Oct 13 10:51:21 2023
# Autogenerated by Sphinx on Wed Nov 22 11:44:32 2023
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@ -5574,7 +5574,7 @@ topics = {'assert': 'The "assert" statement\n'
' Create an alias called *name* that executes *command*. The\n'
' *command* must *not* be enclosed in quotes. Replaceable '
'parameters\n'
' can be indicated by "%1", "%2", and so on, while "%*" is '
' can be indicated by "%1", "%2", … and "%9", while "%*" is '
'replaced\n'
' by all the parameters. If *command* is omitted, the current '
'alias\n'
@ -14650,10 +14650,16 @@ topics = {'assert': 'The "assert" statement\n'
' objects (for example when catching an exception and storing its\n'
' traceback for later use).\n'
'\n'
' "RuntimeError" is raised if the frame is currently executing.\n'
' "RuntimeError" is raised if the frame is currently executing or\n'
' suspended.\n'
'\n'
' New in version 3.4.\n'
'\n'
' Changed in version 3.13: Attempting to clear a suspended frame\n'
' raises "RuntimeError" (as has always been the case for '
'executing\n'
' frames).\n'
'\n'
'\n'
'Traceback objects\n'
'-----------------\n'
@ -15216,21 +15222,23 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'Keys views are set-like since their entries are unique and '
'*hashable*.\n'
'If all values are hashable, so that "(key, value)" pairs are '
'unique\n'
'and hashable, then the items view is also set-like. (Values '
'views are\n'
'not treated as set-like since the entries are generally not '
'unique.)\n'
'For set-like views, all of the operations defined for the '
'abstract\n'
'base class "collections.abc.Set" are available (for example, '
'"==",\n'
'"<", or "^"). While using set operators, set-like views '
'accept any\n'
'iterable as the other operand, unlike sets which only accept '
'sets as\n'
'the input.\n'
'Items views also have set-like operations since the (key, '
'value) pairs\n'
'are unique and the keys are hashable. If all values in an '
'items view\n'
'are hashable as well, then the items view can interoperate '
'with other\n'
'sets. (Values views are not treated as set-like since the '
'entries are\n'
'generally not unique.) For set-like views, all of the '
'operations\n'
'defined for the abstract base class "collections.abc.Set" '
'are\n'
'available (for example, "==", "<", or "^"). While using '
'set\n'
'operators, set-like views accept any iterable as the other '
'operand,\n'
'unlike sets which only accept sets as the input.\n'
'\n'
'An example of dictionary view usage:\n'
'\n'

1622
Misc/NEWS.d/3.13.0a2.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
The ``errno``, ``md5``, ``resource``, ``winsound``, ``_ctypes_test``,
``_multiprocessing.posixshmem``, ``_scproxy``, ``_stat``,
``_testimportmultiple`` and ``_uuid`` C extensions are now built with the
:ref:`limited C API <limited-c-api>`.
Patch by Victor Stinner.

View File

@ -1 +0,0 @@
AIX 32bit needs ``-latomic`` to build the :mod:`!_testcapi` extension module.

View File

@ -1 +0,0 @@
For wasi-threads, memory is now exported to fix compatibility issues with some wasm runtimes.

View File

@ -1,5 +0,0 @@
Add ``Tools/build/regen-configure.sh`` script to regenerate the ``configure``
with an Ubuntu container image. The ``quay.io/tiran/cpython_autoconf:271``
container image (`tiran/cpython_autoconf
<https://github.com/tiran/cpython_autoconf>`_) is no longer used. Patch by
Victor Stinner.

View File

@ -1 +0,0 @@
Make ``make regen-unicodedata`` work for out-of-tree builds of CPython.

View File

@ -1 +0,0 @@
Remove redundant C-contiguity check in :file:`getargs.c`, :mod:`binascii`, :mod:`ssl` and Argument Clinic. Patched by Stefan Krah and Furkan Onder

View File

@ -1,5 +0,0 @@
Functions :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`,
:c:func:`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`,
:c:func:`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, and
:c:func:`PySys_GetObject`, which clear all errors occurred during calling
the function, report now them using :func:`sys.unraisablehook`.

View File

@ -1,3 +0,0 @@
Add :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawCalloc`,
:c:func:`PyMem_RawRealloc` and :c:func:`PyMem_RawFree` to the limited C API.
Patch by Victor Stinner.

View File

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

View File

@ -1,2 +0,0 @@
Introduced :c:func:`PyUnstable_PerfTrampoline_CompileCode`, :c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` and
:c:func:`PyUnstable_CopyPerfMapFile`. These functions allow extension modules to initialize trampolines eagerly, after the application is "warmed up". This makes it possible to have perf-trampolines running in an always-enabled fashion.

View File

@ -1 +0,0 @@
Support non-ASCII keyword names in :c:func:`PyArg_ParseTupleAndKeywords`.

View File

@ -1,2 +0,0 @@
Move the undocumented private _PyArg functions and _PyArg_Parser structure
to internal C API (``pycore_modsupport.h``). Patch by Victor Stinner.

View File

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

View File

@ -1,2 +0,0 @@
In the limited C API version 3.13, :c:func:`Py_SET_REFCNT` function is now
implemented as an opaque function call. Patch by Victor Stinner.

View File

@ -1,3 +0,0 @@
Implement "Python Critical Sections" from :pep:`703`. These are macros to
help replace the GIL with per-object locks in the ``--disable-gil`` build of
CPython. The macros are no-ops in the default build.

View File

@ -1,3 +0,0 @@
On Windows, ``Python.h`` no longer includes the ``<stddef.h>`` standard
header file. If needed, it should now be included explicitly. Patch by
Victor Stinner.

View File

@ -1,2 +0,0 @@
Add :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions: similar to
Python ``list.extend()`` and ``list.clear()`` methods. Patch by Victor Stinner.

View File

@ -1 +0,0 @@
Rename ``Py_NOGIL`` to ``Py_GIL_DISABLED``. Patch by Hugo van Kemenade.

View File

@ -1,4 +0,0 @@
Add :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions: remove a key
from a dictionary and optionally return the removed value. This is similar to
:meth:`dict.pop`, but without the default value and not raising :exc:`KeyError`
if the key missing. Patch by Stefan Behnel and Victor Stinner.

View File

@ -1,2 +0,0 @@
Add internal-only one-time initialization API: ``_PyOnceFlag`` and
``_PyOnceFlag_CallOnce``.

View File

@ -1,3 +0,0 @@
Add again ``<ctype.h>`` and ``<unistd.h>`` includes in ``Python.h``, but
don't include them in the limited C API version 3.13 and newer. Patch by
Victor Stinner.

View File

@ -1,51 +0,0 @@
Restore removed private C API functions, macros and structures which have no
simple replacement for now:
* _PyDict_GetItem_KnownHash()
* _PyDict_NewPresized()
* _PyHASH_BITS
* _PyHASH_IMAG
* _PyHASH_INF
* _PyHASH_MODULUS
* _PyHASH_MULTIPLIER
* _PyLong_Copy()
* _PyLong_FromDigits()
* _PyLong_New()
* _PyLong_Sign()
* _PyObject_CallMethodId()
* _PyObject_CallMethodNoArgs()
* _PyObject_CallMethodOneArg()
* _PyObject_CallOneArg()
* _PyObject_EXTRA_INIT
* _PyObject_FastCallDict()
* _PyObject_GetAttrId()
* _PyObject_Vectorcall()
* _PyObject_VectorcallMethod()
* _PyStack_AsDict()
* _PyThread_CurrentFrames()
* _PyUnicodeWriter structure
* _PyUnicodeWriter_Dealloc()
* _PyUnicodeWriter_Finish()
* _PyUnicodeWriter_Init()
* _PyUnicodeWriter_Prepare()
* _PyUnicodeWriter_PrepareKind()
* _PyUnicodeWriter_WriteASCIIString()
* _PyUnicodeWriter_WriteChar()
* _PyUnicodeWriter_WriteLatin1String()
* _PyUnicodeWriter_WriteStr()
* _PyUnicodeWriter_WriteSubstring()
* _PyUnicode_AsString()
* _PyUnicode_FromId()
* _PyVectorcall_Function()
* _Py_IDENTIFIER()
* _Py_c_abs()
* _Py_c_diff()
* _Py_c_neg()
* _Py_c_pow()
* _Py_c_prod()
* _Py_c_quot()
* _Py_c_sum()
* _Py_static_string()
* _Py_static_string_init()
Patch by Victor Stinner.

View File

@ -1,2 +0,0 @@
Restore the removed ``_PyDict_GetItemStringWithError()`` function. It is
used by numpy. Patch by Victor Stinner.

View File

@ -1,3 +0,0 @@
Add again the private ``_PyThreadState_UncheckedGet()`` function as an alias
to the new public :c:func:`PyThreadState_GetUnchecked` function. Patch by
Victor Stinner.

View File

@ -1 +0,0 @@
Improved error messages for ``elif``/``else`` statements not matching any valid statements. Patch by Jeremiah Vivian.

View File

@ -1 +0,0 @@
Improve error message for unterminated strings with escapes.

View File

@ -1 +0,0 @@
Fix incorrect SystemError about AST constructor recursion depth mismatch.

View File

@ -1,2 +0,0 @@
When PyConfig.stdlib_dir is explicitly set, it's now respected and won't be
overridden by PyConfig.home.

View File

@ -1 +0,0 @@
Add mimalloc memory allocator support.

View File

@ -1 +0,0 @@
Use local events for opcode tracing

View File

@ -1,6 +0,0 @@
Removed chained :class:`classmethod` descriptors (introduced in
:issue:`19072`). This can no longer be used to wrap other descriptors such
as :class:`property`. The core design of this feature was flawed and caused
a number of downstream problems. To "pass-through" a :class:`classmethod`,
consider using the :attr:`!__wrapped__` attribute that was added in Python
3.10.

View File

@ -1,3 +0,0 @@
Fix regression in Python 3.12 where :meth:`types.CodeType.replace` would
produce a broken code object if called on a module or class code object that
contains a comprehension. Patch by Jelle Zijlstra.

View File

@ -1 +0,0 @@
Implement biased reference counting in ``--disable-gil`` builds.

View File

@ -1,3 +0,0 @@
Add :envvar:`PYTHON_PRESITE=package.module` to import a module early in the
interpreter lifecycle before ``site.py`` is executed. Python needs to be
:ref:`built in debug mode <debug-build>` for this option to exist.

View File

@ -1,2 +0,0 @@
Allow the repl to show source code and complete tracebacks. Patch by Pablo
Galindo

View File

@ -1,3 +0,0 @@
Replace ``prev_instr`` on the interpreter frame by ``instr_ptr`` which
points to the beginning of the instruction that is currently executing (or
will execute once the frame resumes).

View File

@ -1,2 +0,0 @@
Fix argument parsing by ``_PyArg_UnpackKeywordsWithVararg`` for functions
defining pos-or-keyword, vararg, and kw-only parameters.

View File

@ -1 +0,0 @@
Return ``NULL`` for ``PyTrace_RETURN`` events caused by an exception

View File

@ -1 +0,0 @@
Fixed crash due to improperly initialized static :exc:`MemoryError` in subinterpreter.

View File

@ -1,2 +0,0 @@
Correctly display the traceback for :exc:`MemoryError` exceptions using the
:mod:`traceback` module. Patch by Pablo Galindo

View File

@ -1 +0,0 @@
Remove unnecessary instruction pointer updates before returning from frames.

View File

@ -1,2 +0,0 @@
Fix error messages for indented blocks with functions and classes with
generic type parameters. Patch by Pablo Galindo

View File

@ -1,2 +0,0 @@
Fix a bug where a :keyword:`global` declaration in an :keyword:`except` block
is rejected when the global is used in the :keyword:`else` block.

View File

@ -1,2 +0,0 @@
Show source lines in tracebacks when using the ``-c`` option when running
Python. Patch by Pablo Galindo

View File

@ -1 +0,0 @@
Fix a regression that prevented jumping across ``is None`` and ``is not None`` when debugging. Patch by Savannah Ostrowski.

View File

@ -1,3 +0,0 @@
Remove ``oparg`` from :opcode:`YIELD_VALUE`. Change ``oparg`` of
:opcode:`RESUME` to include information about the except-depth.
These changes make it possible to simplify the code in generator close.

View File

@ -1,3 +0,0 @@
Added a new environment variable :envvar:`PYTHON_FROZEN_MODULES`. It
determines whether or not frozen modules are ignored by the import machinery,
equivalent of the :option:`-X frozen_modules <-X>` command-line option.

View File

@ -1,2 +0,0 @@
Fix a bug that was causing :exc:`SyntaxWarning` to appear twice when parsing
if invalid syntax is encountered later. Patch by Pablo galindo

View File

@ -1,3 +0,0 @@
Fix an issue in the :mod:`codeop` that was causing :exc:`SyntaxError`
exceptions raised in the presence of invalid syntax to not contain precise
error messages. Patch by Pablo Galindo

View File

@ -1 +0,0 @@
Fix a bug where ``iso2022_jp_3`` and ``iso2022_jp_2004`` codecs read out of bounds

View File

@ -1,2 +0,0 @@
Add support for sharing of True and False between interpreters using the cross-interpreter
API. Patch by Anthony Shaw.

View File

@ -1,2 +0,0 @@
Add support for sharing floats between interpreters using the cross-interpreter
API. Patch by Anthony Shaw.

View File

@ -1 +0,0 @@
Allow type comments in parenthesized ``with`` statements

View File

@ -1,2 +0,0 @@
Speed up :obj:`Traceback` object creation by lazily compute the line number.
Patch by Pablo Galindo

View File

@ -1,9 +0,0 @@
Merge the Tier 1 (bytecode) and Tier 2 (micro-ops) interpreters together,
moving the Tier 2 interpreter loop and switch into
``_PyEval_EvalFrameDefault()`` in ``Python/ceval.c``.
The ``Python/executor.c`` file is gone.
Also the ``TIER_ONE`` and ``TIER_TWO`` macros are now handled
by the code generator.
**Beware!** This changes the environment variables to enable micro-ops and
their debugging to ``PYTHON_UOPS`` and ``PYTHON_LLTRACE``.

View File

@ -1,5 +0,0 @@
The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the instruction is part
of a yield-from or await, and ``0`` otherwise.
The SUSPENDED frame state is now split into ``SUSPENDED`` and
``SUSPENDED_YIELD_FROM``. This simplifies the code in ``_PyGen_yf``.

View File

@ -1,2 +0,0 @@
Add support for sharing tuples between interpreters using the cross-interpreter
API. Patch by Anthony Shaw.

View File

@ -1,2 +0,0 @@
Fix runtime crash when some error happens in opcode
``LOAD_FROM_DICT_OR_DEREF``.

View File

@ -1,3 +0,0 @@
Speed up :meth:`BaseExceptionGroup.derive`,
:meth:`BaseExceptionGroup.subgroup`, and :meth:`BaseExceptionGroup.split` by
changing how they parse passed arguments.

View File

@ -1 +0,0 @@
Specialize slot loads and stores for _Py_T_OBJECT as well as Py_T_OBJECT_EX

View File

@ -1 +0,0 @@
Make sure that tier 2 traces are de-optimized if the code is instrumented

View File

@ -1 +0,0 @@
Joining a thread now ensures the underlying OS thread has exited. This is required for safer fork() in multi-threaded processes.

View File

@ -1,2 +0,0 @@
Use exponential backoff to reduce the number of failed tier 2 optimization
attempts by over 99%.

View File

@ -1 +0,0 @@
Implement native thread ids for GNU KFreeBSD.

View File

@ -1 +0,0 @@
Raise exception if :meth:`frame.clear` is called on a suspended frame.

View File

@ -1,2 +0,0 @@
Deprecate assignment to a function's ``__code__`` field when the new code
object is of a mismatched type (e.g., from a generator to a plain function).

View File

@ -1 +0,0 @@
Make hashlib related modules thread-safe without the GIL

View File

@ -1 +0,0 @@
Enable translating unspecialized ``FOR_ITER`` to Tier 2.

View File

@ -1,4 +0,0 @@
When Python is built in debug mode, set the C recursion limit to 500 instead
of 1500. A debug build is likely built with low optimization level which
implies higher stack memory usage than a release build. Patch by Victor
Stinner.

View File

@ -1 +0,0 @@
Lower the max parser stack depth to 1000 under WASI debug builds.

View File

@ -1,2 +0,0 @@
Change docstrings of :attr:`~object.__dict__` and
:attr:`~object.__weakref__`.

View File

@ -1,3 +0,0 @@
Slightly optimize the Tier 2 (uop) interpreter by only loading ``oparg`` and
``operand`` when needed. Also double the trace size limit again, to 512 this
time.

View File

@ -1 +0,0 @@
Don't include comments in f-string debug expressions. Patch by Pablo Galindo

View File

@ -1,4 +0,0 @@
Add docstrings to the IDLE debugger module. Fix two bugs:
initialize Idb.botframe (should be in Bdb); in Idb.in_rpc_code,
check whether prev_frame is None before trying to use it.
Greatly expand test_debugger.

View File

@ -1,4 +0,0 @@
:mod:`zipinfo` now supports the full range of values in the TZ string
determined by RFC 8536 and detects all invalid formats.
Both Python and C implementations now raise exceptions of the same
type on invalid data.

View File

@ -1 +0,0 @@
Omit the interface scope from an IPv6 address when used as Host header by :mod:`http.client`.

View File

@ -1,5 +0,0 @@
Switch the storage of the unicode codepoint names to use a different
data-structure, a `directed acyclic word graph
<https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton>`_.
This makes the unicodedata shared library about 440 KiB smaller. Contributed by
Carl Friedrich Bolz-Tereick using code from the PyPy project.

View File

@ -1,6 +0,0 @@
Change the behavior of :meth:`tkinter.Text.count`. It now always returns an
integer if one or less counting options are specified. Previously it could
return a single count as a 1-tuple, an integer (only if option ``"update"``
was specified) or ``None`` if no items found. The result is now the same if
``wantobjects`` is set to ``0``.

View File

@ -1 +0,0 @@
Added a parameter ``local_exit`` for :func:`code.interact` to prevent ``exit()`` and ``quit`` from closing ``sys.stdin`` and raise ``SystemExit``.

View File

@ -1 +0,0 @@
Fix returning of empty byte strings after seek in zipfile module

View File

@ -1,7 +0,0 @@
New methods :meth:`mailbox.Maildir.get_info`,
:meth:`mailbox.Maildir.set_info`, :meth:`mailbox.Maildir.get_flags`,
:meth:`mailbox.Maildir.set_flags`, :meth:`mailbox.Maildir.add_flag`,
:meth:`mailbox.Maildir.remove_flag`. These methods speed up accessing a
message's info and/or flags and are useful when it is not necessary to
access the message's contents, as when iterating over a Maildir to find
messages with specific flags.

View File

@ -1 +0,0 @@
Define ``USE_XATTRS`` on Cygwin so that XATTR-related functions in the :mod:`os` module become available.

View File

@ -1,2 +0,0 @@
Add :func:`glob.translate`. This function converts a pathname with shell-style
wildcards to a regular expression.

View File

@ -1,2 +0,0 @@
Make the ``DictProxy`` and ``ListProxy`` types in :mod:`multiprocessing.managers`
:ref:`Generic Alias Types<types-genericalias>` for ``[]`` use in typing contexts.

View File

@ -1,8 +0,0 @@
Change :mod:`compileall` to only strip the stripdir prefix from the full path
recorded in the compiled ``.pyc`` file, when the prefix matches the start of
the full path in its entirety. When the prefix does not match, no stripping is
performed and a warning to this effect is displayed.
Previously all path components of the stripdir prefix that matched the full
path were removed, while those that did not match were left alone (including
ones interspersed between matching components).

View File

@ -1 +0,0 @@
Improved error handling in :mod:`pdb` command line interface, making it produce more concise error messages.

View File

@ -1,2 +0,0 @@
Implement the CLI of the :mod:`symtable` module and improve the repr of
:class:`~symtable.Symbol`.

View File

@ -1 +0,0 @@
Add the :attr:`ipaddress.IPv4Address.ipv6_mapped` property, which retuns the IPv4-mapped IPv6 address.

View File

@ -1,3 +0,0 @@
Improve errors for unsupported look-behind patterns. Now re.error is raised
instead of OverflowError or RuntimeError for too large width of look-behind
pattern.

View File

@ -1 +0,0 @@
Add ``__reduce__`` method to :class:`IPv6Address` in order to keep ``scope_id``

View File

@ -1,2 +0,0 @@
Ensure that :func:`select.kqueue` objects correctly appear as closed in
forked children, to prevent operations on an invalid file descriptor.

View File

@ -1,3 +0,0 @@
Emit deprecation warning for non-integer numbers in :mod:`gettext` functions
and methods that consider plural forms even if the translation was not
found.

View File

@ -1 +0,0 @@
Make line number of function breakpoint more precise in :mod:`pdb`

View File

@ -1,4 +0,0 @@
Fix :func:`tty.setraw` and :func:`tty.setcbreak`: previously they returned
partially modified list of the original tty attributes.
:func:`tty.cfmakeraw` and :func:`tty.cfmakecbreak` now make a copy of the
list of special characters before modifying it.

View File

@ -1 +0,0 @@
Support setting the :class:`asyncio.Runner` loop_factory kwarg in :class:`unittest.IsolatedAsyncioTestCase`

View File

@ -1 +0,0 @@
Expose the setup and cleanup portions of ``asyncio.run_forever()`` as the standalone methods ``asyncio.run_forever_setup()`` and ``asyncio.run_forever_cleanup()``. This allows for tighter integration with GUI event loops.

View File

@ -1 +0,0 @@
Set ``f_trace_lines = True`` on all frames upon :func:`pdb.set_trace()`

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