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4JlG
 hVP6dmKjsl1BM0rgAEF4V2lCslxwI5rGkHL7MUuST+G4yyRfo7jARw9nAOHz9OIo
 fr+S1rry2KPexUTxRFvQ+5dzV01o8ylkleIIZZIQ1Z186LvrDi7YgNqBAdi3bECc
 U+PuLvLEx1SzuuzJQNkstfGHS9Mabu5UvvGj2fZmvGhgOqxFdEtT6/QmHdFEJlnk
 65T5xT6QUE6NlRyzbb044Rs0czCs8tpVZL+LrAhJnnKxufqKUZVOxWwzMkGTG3Ia
 4SUeMr+70+Qs4Uwe3xYqfLvym4AnBDGKgHQaMiEe7gpmqQUgfKIBBORjMBezNiOQ
 DI+fAi+w4+T+aGEhSSjdgyj9NqpSkYjrP1ODpb1I7kKJfronVufUwp1afJoKaLBR
 bLAQKNIAop08zuMY7N7l1hATqpiaFyGlFU4rjH0dNEaQzaGSVqyEOpWanhqOsMPV
 l1AoTMUtJxdM1y/T1WxdKbaN/XoZYznFZbQrCDsPzAXhWHx+1thJBN7BGdCi/Krm
 2f7Kk//8uLj+BuHowMzOzArNvAfCiFPJypPhUktCFU++GvEWnjY=
 =hwKX
 -----END PGP SIGNATURE-----

Merge tag 'v3.11.0a1'

Python 3.11.0a1
This commit is contained in:
Pablo Galindo 2021-10-05 18:07:59 +01:00
commit 350e7a25d6
483 changed files with 5677 additions and 1509 deletions

View file

@ -20,10 +20,10 @@
#define PY_MINOR_VERSION 11
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 0
#define PY_RELEASE_SERIAL 1
/* Version as a string */
#define PY_VERSION "3.11.0a0"
#define PY_VERSION "3.11.0a1"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

File diff suppressed because it is too large Load diff

5098
Misc/NEWS.d/3.11.0a1.rst Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
Fix broken ``make install`` that caused standard library extension modules
to be unnecessarily and incorrectly rebuilt during the install phase of
cpython.

View file

@ -1,2 +0,0 @@
The Windows build now accepts :envvar:`EnableControlFlowGuard` set to
``guard`` to enable CFG.

View file

@ -1 +0,0 @@
Improved error message when building without a Windows SDK installed.

View file

@ -1 +0,0 @@
Enable building using a Visual Studio 2022 install on Windows.

View file

@ -1,2 +0,0 @@
Add support for building with clang thin lto via --with-lto=thin/full. Patch
by Dong-hee Na and Brett Holman.

View file

@ -1,3 +0,0 @@
Generate lines in relevant files for frozen modules. Up until now each of
the files had to be edited manually. This change makes it easier to add to
and modify the frozen modules.

View file

@ -1,7 +0,0 @@
The ncurses function extended_color_content was introduced in 2017
(https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The
ncurses-devel package in CentOS 7 had a older version ncurses resulted in
compilation error. For compiling ncurses with extended color support, we
verify the version of the ncurses library >= 20170401.

View file

@ -1 +0,0 @@
Fixes Haiku platform build.

View file

@ -1,3 +0,0 @@
Windows builds now regenerate frozen modules as the first part of the build.
Previously the regeneration was later in the build, which would require it
to be restarted if any modules had changed.

View file

@ -1,4 +0,0 @@
Freeze stdlib modules that are imported during startup. This provides
significant performance improvements to startup. If necessary, use the
previously added "-X frozen_modules=off" commandline option to force
importing the source modules.

View file

@ -1,3 +0,0 @@
Avoid building with the Windows 11 SDK previews automatically. This may be
overridden by setting the ``DefaultWindowsSDKVersion`` environment variable
before building.

View file

@ -1 +0,0 @@
Add a new :c:func:`PyType_GetName` function to get type's short name.

View file

@ -1,9 +0,0 @@
Remove deprecated ``Py_UNICODE`` APIs: ``PyUnicode_Encode``,
``PyUnicode_EncodeUTF7``, ``PyUnicode_EncodeUTF8``,
``PyUnicode_EncodeUTF16``, ``PyUnicode_EncodeUTF32``,
``PyUnicode_EncodeLatin1``, ``PyUnicode_EncodeMBCS``,
``PyUnicode_EncodeDecimal``, ``PyUnicode_EncodeRawUnicodeEscape``,
``PyUnicode_EncodeCharmap``, ``PyUnicode_EncodeUnicodeEscape``,
``PyUnicode_TransformDecimalToASCII``, ``PyUnicode_TranslateCharmap``,
``PyUnicodeEncodeError_Create``, ``PyUnicodeTranslateError_Create``. See
:pep:`393` and :pep:`624` for reference.

View file

@ -1,2 +0,0 @@
:c:func:`PyCodec_Unregister` is now properly exported as a function in the
Windows Stable ABI DLL.

View file

@ -1,4 +0,0 @@
Remove ``PyErr_SetFromErrnoWithUnicodeFilename()``,
``PyErr_SetFromWindowsErrWithUnicodeFilename()``, and
``PyErr_SetExcFromWindowsErrWithUnicodeFilename()``. They are not documented
and have been deprecated since Python 3.3.

View file

@ -1,14 +0,0 @@
Deprecate the following functions to configure the Python initialization:
* :c:func:`PySys_AddWarnOptionUnicode`
* :c:func:`PySys_AddWarnOption`
* :c:func:`PySys_AddXOption`
* :c:func:`PySys_HasWarnOptions`
* :c:func:`Py_SetPath`
* :c:func:`Py_SetProgramName`
* :c:func:`Py_SetPythonHome`
* :c:func:`Py_SetStandardStreamEncoding`
* :c:func:`_Py_SetProgramFullPath`
Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization
Configuration <init-config>` instead (:pep:`587`).

View file

@ -1 +0,0 @@
The undocumented function :c:func:`Py_FrozenMain` is removed from the Limited API.

View file

@ -1,4 +0,0 @@
The :c:func:`PyType_Ready` function now raises an error if a type is defined
with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function
(:c:member:`PyTypeObject.tp_traverse`).
Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Convert the :c:func:`Py_TYPE` and :c:func:`Py_SIZE` macros to static inline
functions. The :c:func:`Py_SET_TYPE` and :c:func:`Py_SET_SIZE` functions
must now be used to set an object type and size. Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
:c:func:`Py_IS_TYPE` no longer uses :c:func:`Py_TYPE` to avoid a compiler
warning: no longer cast ``const PyObject*`` to ``PyObject*``.
Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
The list in :ref:`stable-abi-list` now shows the public name
:c:struct:`PyFrameObject` rather than ``_frame``. The non-existing
entry ``_node`` no longer appears in the list.

View file

@ -1 +0,0 @@
Removed documentation for the removed ``PyParser_*`` C API.

View file

@ -1,20 +0,0 @@
Remove 4 private trashcan C API functions which were only kept for the backward
compatibility of the stable ABI with Python 3.8 and older, since the trashcan
API was not usable with the limited C API on Python 3.8 and older. The
trashcan API was excluded from the limited C API in Python 3.9.
Removed functions:
* _PyTrash_deposit_object()
* _PyTrash_destroy_chain()
* _PyTrash_thread_deposit_object()
* _PyTrash_thread_destroy_chain()
The trashcan C API was never usable with the limited C API, since old trashcan
macros accessed directly :c:type:`PyThreadState` members like
``_tstate->trash_delete_nesting``, whereas the :c:type:`PyThreadState`
structure is opaque in the limited C API.
Exclude also the the ``PyTrash_UNWIND_LEVEL`` constant from the C API.
Patch by Victor Stinner.

View file

@ -1,4 +0,0 @@
:c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to its initial value
at exit. It must be possible to call :c:func:`PyImport_AppendInittab` or
:c:func:`PyImport_ExtendInittab` at each Python initialization.
Patch by Victor Stinner.

View file

@ -1,4 +0,0 @@
Added the ``co_qualname`` to the ``PyCodeObject`` structure to propagate the
qualified name from the compiler to code objects.
Patch by Gabriele N. Tornetta

View file

@ -1,4 +0,0 @@
The ``Py_TPFLAGS_HAVE_VERSION_TAG`` type flag now does nothing. The
``Py_TPFLAGS_HAVE_AM_SEND`` flag (which was added in 3.10) is removed. Both
were unnecessary because it is not possible to have type objects with the
relevant fields missing.

View file

@ -1 +0,0 @@
Remove ``crypt.h`` include from the public ``Python.h`` header.

View file

@ -1,2 +0,0 @@
Reverts removal of the old buffer protocol because they are part of stable
ABI.

View file

@ -1,2 +0,0 @@
Add a new :c:func:`PyType_GetQualName` function to get type's qualified
name.

View file

@ -1,3 +0,0 @@
Add a deallocator to the :class:`bool` type to detect refcount bugs in C
extensions which call ``Py_DECREF(Py_True);`` or ``Py_DECREF(Py_False);`` by
mistake. Patch by Victor Stinner.

View file

@ -1,2 +0,0 @@
Add the :c:macro:`Py_NO_INLINE` macro to disable inlining on a function.
Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Add the :c:macro:`Py_ALWAYS_INLINE` macro to ask the compiler to always
inline a static inline function. The compiler can ignore it and decides to
not inline the function. Patch by Victor Stinner.

View file

@ -1 +0,0 @@
:meth:`BufferedReader.peek` no longer raises :exc:`ValueError` when the entire file has already been buffered.

View file

@ -1,2 +0,0 @@
The PyThread_acquire_lock_timed() function now clamps the timeout if it is
too large, rather than aborting the process. Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Asynchronous comprehensions are now allowed inside comprehensions in
asynchronous functions. Outer comprehensions implicitly become
asynchronous.

View file

@ -1 +0,0 @@
Fix crash when using passing a non-exception to a generator's ``throw()`` method. Patch by Noah Oxer

View file

@ -1,3 +0,0 @@
When compiling :class:`ast.AST` objects with recursive references
through :func:`compile`, the interpreter doesn't crash anymore instead
it raises a :exc:`RecursionError`.

View file

@ -1 +0,0 @@
Fix a confusing error message in :func:`str.format`.

View file

@ -1 +0,0 @@
More accurate error messages for access of unbound locals or free vars.

View file

@ -1,4 +0,0 @@
Compute cell offsets relative to locals in compiler. Allows the interpreter
to treats locals and cells a single array, which is slightly more efficient.
Also make the LOAD_CLOSURE opcode an alias for LOAD_FAST. Preserving
LOAD_CLOSURE helps keep bytecode a bit more readable.

View file

@ -1 +0,0 @@
Add native_thread_id to PyThreadState. Patch by Gabriele N. Tornetta.

View file

@ -1,4 +0,0 @@
Emit a deprecation warning if the numeric literal is immediately followed by
one of keywords: and, else, for, if, in, is, or. Raise a syntax error with
more informative message if it is immediately followed by other keyword or
identifier.

View file

@ -1 +0,0 @@
Document the signature and ``default`` argument in the docstring of the new ``anext`` builtin.

View file

@ -1,7 +0,0 @@
"Zero cost" exception handling.
* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
Patch by Mark Shannon

View file

@ -1,2 +0,0 @@
The parser will prioritize tokenizer errors over custom syntax errors when
raising exceptions. Patch by Pablo Galindo.

View file

@ -1,2 +0,0 @@
Corrent the syntax error message regarding multiple exception types to not
refer to "exception groups". Patch by Pablo Galindo

View file

@ -1,3 +0,0 @@
Compiler now optimizes simple C-style formatting with literal format
containing only format codes %s, %r and %a by converting them to f-string
expressions.

View file

@ -1,3 +0,0 @@
Add ``CALL_METHOD_KW`` opcode to speed up method calls with keyword
arguments. Idea originated from PyPy. A side effect is executing
``CALL_METHOD`` is now branchless in the evaluation loop.

View file

@ -1 +0,0 @@
Improve :func:`str.__getitem__` error message

View file

@ -1 +0,0 @@
Fix incorrect dictkeys_reversed and dictitems_reversed function signatures in C code, which broke webassembly builds.

View file

@ -1,2 +0,0 @@
Move 'fast' locals and other variables from the frame object to a per-thread
datastack.

View file

@ -1,2 +0,0 @@
Fixed a crash in the parser that manifest when raising tokenizer errors when
an existing exception was present. Patch by Pablo Galindo.

View file

@ -1 +0,0 @@
String caches in ``compile.c`` are now subinterpreter compatible.

View file

@ -1,2 +0,0 @@
Fix error message in the parser involving keyword arguments with invalid
expressions. Patch by Pablo Galindo

View file

@ -1,3 +0,0 @@
The parser doesn't report generic syntax errors that happen in a position
further away that the one it reached in the first pass. Patch by Pablo
Galindo

View file

@ -1,3 +0,0 @@
Implement quickening in the interpreter. This offers no advantages as
yet, but is an enabler of future optimizations. See PEP 659 for full
explanation.

View file

@ -1,3 +0,0 @@
Fix a crash at Python exit when a deallocator function removes the last strong
reference to a heap type.
Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
``PyCodeObject`` gained ``co_fastlocalnames`` and ``co_fastlocalkinds`` as
the the authoritative source of fast locals info. Marshaled code objects
have changed accordingly.

View file

@ -1,3 +0,0 @@
Avoid side effects of checking for specialized syntax errors in the REPL
that was causing it to ask for extra tokens after a syntax error had been
detected. Patch by Pablo Galindo

View file

@ -1,4 +0,0 @@
Fix a regression in :func:`type` when a metaclass raises an exception. The C
function :c:func:`type_new` must properly report the exception when a metaclass
constructor raises an exception and the winner class is not the metaclass.
Patch by Victor Stinner.

View file

@ -1,5 +0,0 @@
A new opcode MAKE_CELL has been added that effectively moves some of
the work done on function entry into the compiler and into the eval
loop. In addition to creating the required cell objects, the new
opcode converts relevant arguments (and other locals) to cell
variables on function entry.

View file

@ -1,2 +0,0 @@
Improve Unicode support in non-UTF locales on Oracle Solaris. This issue
does not affect other Solaris systems.

View file

@ -1,4 +0,0 @@
Constructors of subclasses of some buitin classes (e.g. :class:`tuple`,
:class:`list`, :class:`frozenset`) no longer accept arbitrary keyword
arguments. Subclass of :class:`set` can now define a ``__new__()`` method
with additional keyword parameters without overriding also ``__init__()``.

View file

@ -1,2 +0,0 @@
Improve error message for ``try`` blocks without ``except`` or ``finally``
blocks. Patch by Pablo Galindo.

View file

@ -1,2 +0,0 @@
Fix a crash in the :mod:`sqlite3` module that happened when the garbage
collector clears :class:`sqlite.Statement` objects. Patch by Pablo Galindo

View file

@ -1 +0,0 @@
Improve tokenizer error with improved locations. Patch by Pablo Galindo.

View file

@ -1,4 +0,0 @@
Computation of the offsets of cell variables is done in the compiler instead
of at runtime. This reduces the overhead of handling cell and free
variables, especially in the case where a variable is both an argument and
cell variable.

View file

@ -1,2 +0,0 @@
Fix a regression when identifying incorrect characters in syntax errors.
Patch by Pablo Galindo

View file

@ -1,11 +0,0 @@
Initial implementation of adaptive specialization of LOAD_ATTR
Four specialized forms of LOAD_ATTR are added:
* LOAD_ATTR_SLOT
* LOAD_ATTR_SPLIT_KEYS
* LOAD_ATTR_WITH_HINT
* LOAD_ATTR_MODULE

View file

@ -1 +0,0 @@
Fix an edge case when displaying text from files with encoding in syntax errors. Patch by Pablo Galindo.

View file

@ -1 +0,0 @@
Improve syntax errors for invalid "as" targets. Patch by Pablo Galindo

View file

@ -1,7 +0,0 @@
Implement adaptive specialization for LOAD_GLOBAL
Two specialized forms of LOAD_GLOBAL are added:
* LOAD_GLOBAL_MODULE
* LOAD_GLOBAL_BUILTIN

View file

@ -1,4 +0,0 @@
Directly imported objects and modules (through import and from import
statements) don't generate ``LOAD_METHOD``/``CALL_METHOD`` for directly
accessed objects on their namespace. They now use the regular
``LOAD_ATTR``/``CALL_FUNCTION``.

View file

@ -1 +0,0 @@
Exact integer exponentiation (like ``i**2`` or ``pow(i, 2)``) with a small exponent is much faster, due to reducing overhead in such cases.

View file

@ -1,2 +0,0 @@
Fix a possible crash in the tokenizer when raising syntax errors for
unclosed strings. Patch by Pablo Galindo.

View file

@ -1,2 +0,0 @@
Fix error location information for tokenizer errors raised on initialization
of the tokenizer. Patch by Pablo Galindo.

View file

@ -1,2 +0,0 @@
Improve the syntax error when mixing positional and keyword patterns. Patch
by Pablo Galindo.

View file

@ -1,3 +0,0 @@
Make sure that the line number is set when entering a comprehension scope.
Ensures that backtraces inclusing generator expressions show the correct
line number.

View file

@ -1,4 +0,0 @@
A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in
:keyword:`with` and :keyword:`async with` statements for objects which do
not support the :term:`context manager` or :term:`asynchronous context
manager` protocols correspondingly.

View file

@ -1 +0,0 @@
Fix ltrace functionality when exceptions are raised. Patch by Pablo Galindo

View file

@ -1,2 +0,0 @@
Modules will always have a dictionary, even when created by
``types.ModuleType.__new__()``

View file

@ -1,2 +0,0 @@
Fix a crash in ``types.Union`` objects when creating a union of an object
with bad ``__module__`` field.

View file

@ -1,3 +0,0 @@
Remove the pass-through for :func:`hash` of :class:`weakref.proxy` objects
to prevent unintended consequences when the original referred object
dies while the proxy is part of a hashable object. Patch by Pablo Galindo.

View file

@ -1,2 +0,0 @@
Add ``__parameters__`` attribute and ``__getitem__``
operator to ``types.Union``. Patch provided by Yurii Karabas.

View file

@ -1,2 +0,0 @@
Implement GC methods for ``types.Union`` to break reference cycles and
prevent memory leaks.

View file

@ -1,3 +0,0 @@
Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit the
:pep:`590` vectorcall protocol. Previously, this was only possible for
:ref:`static types <static-types>`. Patch by Erlend E. Aasland.

View file

@ -1,3 +0,0 @@
Fix a memory consumption and copying performance regression in earlier 3.10
beta releases if someone used an output buffer larger than 4GiB with
zlib.decompress on input data that expands that large.

View file

@ -1,2 +0,0 @@
Remove uses of :c:func:`PyObject_GC_Del` in error path when initializing
:class:`types.GenericAlias`.

View file

@ -1,6 +0,0 @@
Code objects can now provide the column information for instructions when
available. This is levaraged during traceback printing to show the
expressions responsible for errors.
Contributed by Pablo Galindo, Batuhan Taskaya and Ammar Askar as part of
:pep:`657`.

View file

@ -1,3 +0,0 @@
:mod:`typing` now searches for type parameters in ``types.Union`` objects.
``get_type_hints`` will also properly resolve annotations with nested
``types.Union`` objects. Patch provided by Yurii Karabas.

View file

@ -1,4 +0,0 @@
An obsolete internal cache of shared object file handles added in 1995 that
attempted, but did not guarantee, that a .so would not be dlopen'ed twice to
work around flaws in mid-1990s posix-ish operating systems has been removed
from dynload_shlib.c.

View file

@ -1,3 +0,0 @@
The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is
deprecated in Python 3.10 and will be removed in Python 3.12. This feature
requires a debug build of Python. Patch by Victor Stinner.

View file

@ -1,5 +0,0 @@
All necessary data for executing a Python function (local variables, stack,
etc) is now kept in a per-thread stack. Frame objects are lazily allocated
on demand. This increases performance by about 7% on the standard benchmark
suite. Introspection and debugging are unaffected as frame objects are
always available when needed. Patch by Mark Shannon.

View file

@ -1 +0,0 @@
Tuned the string-searching algorithm of fastsearch.h to have a shorter inner loop for most cases.

View file

@ -1,2 +0,0 @@
The ``@classmethod`` decorator can now wrap other classmethod-like
descriptors.

View file

@ -1 +0,0 @@
Fix ``__instancecheck__`` and ``__subclasscheck__`` for the union type.

View file

@ -1,2 +0,0 @@
Mapping patterns in ``match`` statements with two or more equal literal
keys will now raise a :exc:`SyntaxError` at compile-time.

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