Python 3.14.0b1

This commit is contained in:
Hugo van Kemenade 2025-05-06 18:33:32 +03:00
parent 5f01b00dea
commit b092705907
237 changed files with 2243 additions and 583 deletions

View file

@ -274,7 +274,7 @@ small to receive the value.
Convert a Python integer to a C :c:expr:`unsigned long` without
overflow checking.
.. versionchanged:: next
.. versionchanged:: 3.14
Use :meth:`~object.__index__` if available.
``L`` (:class:`int`) [long long]
@ -284,7 +284,7 @@ small to receive the value.
Convert a Python integer to a C :c:expr:`unsigned long long`
without overflow checking.
.. versionchanged:: next
.. versionchanged:: 3.14
Use :meth:`~object.__index__` if available.
``n`` (:class:`int`) [:c:type:`Py_ssize_t`]
@ -380,10 +380,10 @@ Other objects
The *converter* for the ``O&`` format unit in *items* must not store
a borrowed buffer or a borrowed reference.
.. versionchanged:: next
.. versionchanged:: 3.14
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.
.. deprecated:: next
.. deprecated:: 3.14
Non-tuple sequences are deprecated if *items* contains format units
which store a borrowed buffer or a borrowed reference.
@ -396,7 +396,7 @@ Other objects
If the argument is not ``None``, it is parsed according to the specified
format unit.
.. versionadded:: next
.. versionadded:: 3.14
A few other characters have a meaning in a format string. These may not occur
inside nested parentheses. They are:

View file

@ -1486,7 +1486,7 @@ PyConfig
Default: ``0``.
.. versionchanged:: next
.. versionchanged:: 3.14
Added support for ``import_time = 2``

View file

@ -626,7 +626,7 @@ which, when run, will produce:
of each message with the handler's level, and only passes a message to a
handler if it's appropriate to do so.
.. versionchanged:: next
.. versionchanged:: 3.14
The :class:`QueueListener` can be started (and stopped) via the
:keyword:`with` statement. For example:

View file

@ -641,7 +641,7 @@ keyword argument::
>>> parser = argparse.ArgumentParser(description='Process some integers.')
>>> parser.color = True
.. versionadded:: next
.. versionadded:: 3.14
The add_argument() method

View file

@ -2577,21 +2577,21 @@ The following options are accepted:
Python version in the format 3.x (for example, 3.10). Defaults to the
current version of the interpreter.
.. versionadded:: next
.. versionadded:: 3.14
.. option:: -O <level>
--optimize <level>
Optimization level for parser. Defaults to no optimization.
.. versionadded:: next
.. versionadded:: 3.14
.. option:: --show-empty
Show empty lists and fields that are ``None``. Defaults to not showing empty
objects.
.. versionadded:: next
.. versionadded:: 3.14
If :file:`infile` is specified its contents are parsed to AST and dumped

View file

@ -388,7 +388,7 @@ Creating Futures and Tasks
.. versionchanged:: 3.11
Added the *context* parameter.
.. versionchanged:: next
.. versionchanged:: 3.14
Added the *eager_start* parameter.
.. method:: loop.set_task_factory(factory)

View file

@ -48,5 +48,5 @@ public API of CPython:
| ctypes.PyObj_FromPtr | ``obj`` |
+----------------------------+-------------------------------------------+
.. versionadded:: next
.. versionadded:: 3.14
The ``_posixsubprocess.fork_exec`` internal audit event.

View file

@ -208,7 +208,7 @@ wider range of codecs when working with binary files:
.. versionchanged:: 3.11
The ``'U'`` mode has been removed.
.. deprecated:: next
.. deprecated:: 3.14
:func:`codecs.open` has been superseded by :func:`open`.

View file

@ -2358,7 +2358,7 @@ Data types
:func:`POINTER` for corresponding ctypes data type. If a pointer type
was not yet created, the attribute is missing.
.. versionadded:: next
.. versionadded:: 3.14
Common instance variables of ctypes data types:
@ -2756,7 +2756,7 @@ fields, or any other data types containing pointer type fields.
This is only implemented for the MSVC-compatible memory layout.
.. deprecated-removed:: next 3.19
.. deprecated-removed:: 3.14 3.19
For historical reasons, if :attr:`!_pack_` is non-zero,
the MSVC-compatible layout will be used by default.
@ -2799,7 +2799,7 @@ fields, or any other data types containing pointer type fields.
:attr:`!_layout_` must already be defined when
:attr:`~Structure._fields_` is assigned, otherwise it will have no effect.
.. versionadded:: next
.. versionadded:: 3.14
.. attribute:: _anonymous_

View file

@ -80,7 +80,7 @@ The module :mod:`curses` defines the following functions:
* Change the definition of the color-pair ``0`` to ``(fg, bg)``.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: baudrate()

View file

@ -1037,7 +1037,7 @@ function to temporarily change the active context.
IEEE interchange formats. The argument must be a multiple of 32 and less
than :const:`IEEE_CONTEXT_MAX_BITS`.
.. versionadded:: next
.. versionadded:: 3.14
New contexts can also be created using the :class:`Context` constructor
described below. In addition, the module provides three pre-made contexts:

View file

@ -436,7 +436,7 @@ The following exceptions are the exceptions that are usually raised.
.. versionadded:: 3.13
Previously, a plain :exc:`RuntimeError` was raised.
.. versionchanged:: next
.. versionchanged:: 3.14
:meth:`threading.Thread.join` can now raise this exception.

View file

@ -69,7 +69,7 @@ Dumping the traceback
Dumping the C stack
-------------------
.. versionadded:: next
.. versionadded:: 3.14
.. function:: dump_c_stack(file=sys.stderr)
@ -130,7 +130,7 @@ Fault handler state
Only the current thread is dumped if the :term:`GIL` is disabled to
prevent the risk of data races.
.. versionchanged:: next
.. versionchanged:: 3.14
The dump now displays the C stack trace if *c_stack* is true.
.. function:: disable()

View file

@ -79,7 +79,7 @@ descriptor.
On macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE``
and ``F_SETNOSIGPIPE`` constant.
.. versionchanged:: next
.. versionchanged:: 3.14
On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY``
to query a file descriptor pointing to the same file.
@ -121,7 +121,7 @@ The module defines the following functions:
.. audit-event:: fcntl.fcntl fd,cmd,arg fcntl.fcntl
.. versionchanged:: next
.. versionchanged:: 3.14
Add support of arbitrary :term:`bytes-like objects <bytes-like object>`,
not only :class:`bytes`.
@ -181,7 +181,7 @@ The module defines the following functions:
.. audit-event:: fcntl.ioctl fd,request,arg fcntl.ioctl
.. versionchanged:: next
.. versionchanged:: 3.14
The GIL is always released during a system call.
System calls failing with EINTR are automatically retried.

View file

@ -39,7 +39,7 @@ The :mod:`getpass` module provides two functions:
If you call getpass from within IDLE, the input may be done in the
terminal you launched IDLE from rather than the idle window itself.
.. versionchanged:: next
.. versionchanged:: 3.14
Added the *echo_char* parameter for keyboard feedback.
.. exception:: GetPassWarning

View file

@ -302,7 +302,7 @@ a file or file-like object.
.. versionadded:: 3.11
.. versionchanged:: next
.. versionchanged:: 3.14
Now raises a :exc:`BlockingIOError` if the file is opened in blocking
mode. Previously, spurious null bytes were added to the digest.

View file

@ -105,7 +105,7 @@ For max-heaps, the following functions are provided:
Transform list *x* into a max-heap, in-place, in linear time.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: heappush_max(heap, item)
@ -113,7 +113,7 @@ For max-heaps, the following functions are provided:
Push the value *item* onto the max-heap *heap*, maintaining the max-heap
invariant.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: heappop_max(heap)
@ -122,7 +122,7 @@ For max-heaps, the following functions are provided:
max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised.
To access the largest item without popping it, use ``maxheap[0]``.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: heappushpop_max(heap, item)
@ -132,7 +132,7 @@ For max-heaps, the following functions are provided:
The combined action runs more efficiently than :func:`heappush_max`
followed by a separate call to :func:`heappop_max`.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: heapreplace_max(heap, item)
@ -145,7 +145,7 @@ For max-heaps, the following functions are provided:
The value returned may be smaller than the *item* added. Refer to the
analogous function :func:`heapreplace` for detailed usage notes.
.. versionadded:: next
.. versionadded:: 3.14
The module also offers three general purpose functions based on heaps.

View file

@ -1148,7 +1148,7 @@ possible, while any potentially slow operations (such as sending an email via
.. versionchanged:: 3.5
The ``respect_handler_level`` argument was added.
.. versionchanged:: next
.. versionchanged:: 3.14
:class:`QueueListener` can now be used as a context manager via
:keyword:`with`. When entering the context, the listener is started. When
exiting the context, the listener is stopped.
@ -1186,7 +1186,7 @@ possible, while any potentially slow operations (such as sending an email via
This starts up a background thread to monitor the queue for
LogRecords to process.
.. versionchanged:: next
.. versionchanged:: 3.14
Raises :exc:`RuntimeError` if called and the listener is already
running.

View file

@ -687,7 +687,7 @@ The :mod:`multiprocessing` package mostly replicates the API of the
:attr:`exitcode` you may simply catch :exc:`KeyboardInterrupt` and call
``exit(your_code)``.
.. versionadded:: next
.. versionadded:: 3.14
.. method:: terminate()

View file

@ -871,7 +871,7 @@ conforming to :rfc:`8089`.
.. versionadded:: 3.13
.. versionchanged:: next
.. versionchanged:: 3.14
The URL authority is discarded if it matches the local hostname.
Otherwise, if the authority isn't empty or ``localhost``, then on
Windows a UNC path is returned (as before), and on other platforms a

View file

@ -667,7 +667,7 @@ character ``'$'``.
``\z``
Matches only at the end of the string.
.. versionadded:: next
.. versionadded:: 3.14
``\Z``
The same as ``\z``. For compatibility with old Python versions.

View file

@ -76,7 +76,7 @@ The following functions relate to the init file and user configuration:
if given, and :code:`"<readline_init_file>"` otherwise, regardless of
which file the library resolves.
.. versionchanged:: next
.. versionchanged:: 3.14
The auditing event was added.
@ -119,7 +119,7 @@ The following functions operate on a history file:
and raises an :ref:`auditing event <auditing>` ``open`` with the file
name if given and :code:`"~/.history"` otherwise.
.. versionchanged:: next
.. versionchanged:: 3.14
The auditing event was added.
@ -131,7 +131,7 @@ The following functions operate on a history file:
:ref:`auditing event <auditing>` ``open`` with the file name if given and
:code:`"~/.history"` otherwise.
.. versionchanged:: next
.. versionchanged:: 3.14
The auditing event was added.
@ -146,7 +146,7 @@ The following functions operate on a history file:
.. versionadded:: 3.5
.. versionchanged:: next
.. versionchanged:: 3.14
The auditing event was added.

View file

@ -170,7 +170,7 @@ created. Socket addresses are represented as follows:
.. versionchanged:: 3.13.3
FreeBSD support added.
.. versionchanged:: next
.. versionchanged:: 3.14
Added ``channel`` field.
``device_id`` not packed in a tuple is now accepted.
@ -178,7 +178,7 @@ created. Socket addresses are represented as follows:
the Bluetooth address as a string or a :class:`bytes` object.
(ex. ``'12:23:34:45:56:67'`` or ``b'12:23:34:45:56:67'``)
.. versionchanged:: next
.. versionchanged:: 3.14
FreeBSD support added.
- :const:`AF_ALG` is a Linux-only socket based interface to Kernel
@ -498,7 +498,7 @@ Constants
.. versionchanged:: 3.11
NetBSD support was added.
.. versionchanged:: next
.. versionchanged:: 3.14
Restored missing ``CAN_RAW_ERR_FILTER`` on Linux.
.. data:: CAN_BCM
@ -709,7 +709,7 @@ Constants
:const:`!SO_BTH_*` are only available on Windows.
Other constants may be available on Linux and various BSD platforms.
.. versionadded:: next
.. versionadded:: 3.14
.. data:: HCI_FILTER
HCI_TIME_STAMP
@ -720,7 +720,7 @@ Constants
Option names for use with :const:`BTPROTO_HCI`.
Availability and format of the option values depend on platform.
.. versionchanged:: next
.. versionchanged:: 3.14
Added :const:`!SO_HCI_EVT_FILTER` and :const:`!SO_HCI_PKT_FILTER`
on NetBSD and DragonFly BSD.
Added :const:`!HCI_DATA_DIR` on FreeBSD, NetBSD and DragonFly BSD.
@ -732,7 +732,7 @@ Constants
.. availability:: Linux
.. versionadded:: next
.. versionadded:: 3.14
.. data:: HCI_CHANNEL_RAW
HCI_CHANNEL_USER
@ -744,7 +744,7 @@ Constants
.. availability:: Linux
.. versionadded:: next
.. versionadded:: 3.14
.. data:: AF_QIPCRTR

View file

@ -1292,7 +1292,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
``sys._jit`` is not guaranteed to exist or behave the same way in all
Python implementations, versions, or build configurations.
.. versionadded:: next
.. versionadded:: 3.14
.. function:: _jit.is_available()

View file

@ -167,7 +167,7 @@ Some facts and figures:
.. versionchanged:: 3.12
The *compresslevel* keyword argument also works for streams.
.. versionchanged:: next
.. versionchanged:: 3.14
The *preset* keyword argument also works for streams.

View file

@ -561,7 +561,7 @@ since it is impossible to detect the termination of alien threads.
of :term:`Python finalization <interpreter shutdown>` :meth:`!join`
raises a :exc:`PythonFinalizationError`.
.. versionchanged:: next
.. versionchanged:: 3.14
May raise :exc:`PythonFinalizationError`.

View file

@ -140,7 +140,7 @@ The token constants are:
The token string includes the prefix and the opening quote(s), but none
of the contents of the literal.
.. versionadded:: next
.. versionadded:: 3.14
.. data:: TSTRING_MIDDLE
@ -154,7 +154,7 @@ The token constants are:
:data:`LBRACE`, :data:`RBRACE`, :data:`EXCLAMATION` and :data:`COLON`
tokens.
.. versionadded:: next
.. versionadded:: 3.14
.. data:: TSTRING_END
@ -164,7 +164,7 @@ The token constants are:
The token string contains the closing quote(s).
.. versionadded:: next
.. versionadded:: 3.14
.. data:: ENDMARKER

View file

@ -171,7 +171,7 @@ The :mod:`urllib.request` module defines the following functions:
sections. For example, the path ``/etc/hosts`` is converted to
the URL ``///etc/hosts``.
.. versionchanged:: next
.. versionchanged:: 3.14
The *add_scheme* parameter was added.
@ -204,13 +204,13 @@ The :mod:`urllib.request` module defines the following functions:
characters not following a drive letter no longer cause an
:exc:`OSError` exception to be raised on Windows.
.. versionchanged:: next
.. versionchanged:: 3.14
The URL authority is discarded if it matches the local hostname.
Otherwise, if the authority isn't empty or ``localhost``, then on
Windows a UNC path is returned (as before), and on other platforms a
:exc:`~urllib.error.URLError` is raised.
.. versionchanged:: next
.. versionchanged:: 3.14
The *require_scheme* and *resolve_host* parameters were added.

View file

@ -29,7 +29,7 @@ already registered browsers this browser is added to the front of the search lis
if the part does not contain ``%s``, it is simply interpreted as the name of the
browser to launch. [1]_
.. versionchanged:: next
.. versionchanged:: 3.14
The :envvar:`BROWSER` variable can now also be used to reorder the list of
platform defaults. This is particularly useful on macOS where the platform

View file

@ -3346,7 +3346,7 @@ left undefined.
argument if the three-argument version of the built-in :func:`pow` function
is to be supported.
.. versionchanged:: next
.. versionchanged:: 3.14
Three-argument :func:`pow` now try calling :meth:`~object.__rpow__` if necessary.
Previously it was only called in two-argument :func:`!pow` and the binary

View file

@ -73,7 +73,7 @@ source.
.. audit-event:: cpython.run_command command cmdoption-c
.. versionchanged:: next
.. versionchanged:: 3.14
*command* is automatically dedented before execution.
.. option:: -m <module-name>
@ -549,7 +549,7 @@ Miscellaneous options
.. versionadded:: 3.7
.. versionchanged:: next
.. versionchanged:: 3.14
Added ``-X importtime=2`` to also trace imports of loaded modules,
and reserved values other than ``1`` and ``2`` for future use.
@ -680,7 +680,7 @@ Miscellaneous options
.. versionchanged:: 3.10
Removed the ``-X oldparser`` option.
.. versionremoved:: next
.. versionremoved:: 3.14
:option:`!-J` is no longer reserved for use by Jython_,
and now has no special meaning.
@ -999,7 +999,7 @@ conflict.
.. versionadded:: 3.7
.. versionchanged:: next
.. versionchanged:: 3.14
Added ``PYTHONPROFILEIMPORTTIME=2`` to also trace imports of loaded modules.

View file

@ -20,11 +20,11 @@
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 14
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 7
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA
#define PY_RELEASE_SERIAL 1
/* Version as a string */
#define PY_VERSION "3.14.0a7+"
#define PY_VERSION "3.14.0b1"
/*--end constants--*/

View file

@ -1,4 +1,4 @@
# Autogenerated by Sphinx on Tue Apr 8 14:20:44 2025
# Autogenerated by Sphinx on Tue May 6 18:33:44 2025
# as part of the release process.
topics = {
@ -1784,9 +1784,8 @@ Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.
Changed in version 3.14.0a6 (unreleased): Support for optionally
dropping grouping parentheses when using multiple exception types. See
**PEP 758**.
Changed in version 3.14: Support for optionally dropping grouping
parentheses when using multiple exception types. See **PEP 758**.
"except" clause
@ -1976,9 +1975,9 @@ Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.
Changed in version 3.14.0a6 (unreleased): The compiler emits a
"SyntaxWarning" when a "return", "break" or "continue" appears in a
"finally" block (see **PEP 765**).
Changed in version 3.14: The compiler emits a "SyntaxWarning" when a
"return", "break" or "continue" appears in a "finally" block (see
**PEP 765**).
The "with" statement
@ -3933,6 +3932,19 @@ pdb.set_trace(*, header=None, commands=None)
Added in version 3.14: The *commands* argument.
awaitable pdb.set_trace_async(*, header=None, commands=None)
async version of "set_trace()". This function should be used inside
an async function with "await".
async def f():
await pdb.set_trace_async()
"await" statements are supported if the debugger is invoked by this
function.
Added in version 3.14.
pdb.post_mortem(t=None)
Enter post-mortem debugging of the given exception or traceback
@ -3970,7 +3982,7 @@ The "run*" functions and "set_trace()" are aliases for instantiating
the "Pdb" class and calling the method of the same name. If you want
to access further features, you have to do this yourself:
class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True, mode=None, backend=None)
class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True, mode=None, backend=None, colorize=False)
"Pdb" is the debugger class.
@ -4001,6 +4013,10 @@ class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=Fa
See "set_default_backend()". Otherwise the supported backends are
"'settrace'" and "'monitoring'".
The *colorize* argument, if set to "True", will enable colorized
output in the debugger, if color is supported. This will highlight
source code displayed in pdb.
Example call to enable tracing with *skip*:
import pdb; pdb.Pdb(skip=['django.*']).set_trace()
@ -4018,6 +4034,8 @@ class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=Fa
Added in version 3.14: Added the *backend* argument.
Added in version 3.14: Added the *colorize* argument.
Changed in version 3.14: Inline breakpoints like "breakpoint()" or
"pdb.set_trace()" will always stop the program at calling frame,
ignoring the *skip* pattern (if any).
@ -4496,7 +4514,7 @@ exceptions [excnumber]
When using "pdb.pm()" or "Pdb.post_mortem(...)" with a chained
exception instead of a traceback, it allows the user to move
between the chained exceptions using "exceptions" command to list
exceptions, and "exception <number>" to switch to that exception.
exceptions, and "exceptions <number>" to switch to that exception.
Example:
@ -6752,8 +6770,8 @@ object.__or__(self, other)
called. The "__divmod__()" method should be the equivalent to
using "__floordiv__()" and "__mod__()"; it should not be related to
"__truediv__()". Note that "__pow__()" should be defined to accept
an optional third argument if the ternary version of the built-in
"pow()" function is to be supported.
an optional third argument if the three-argument version of the
built-in "pow()" function is to be supported.
If one of those methods does not support the operation with the
supplied arguments, it should return "NotImplemented".
@ -6785,8 +6803,13 @@ object.__ror__(self, other)
called if "type(x).__sub__(x, y)" returns "NotImplemented" or
"type(y)" is a subclass of "type(x)". [5]
Note that ternary "pow()" will not try calling "__rpow__()" (the
coercion rules would become too complicated).
Note that "__rpow__()" should be defined to accept an optional
third argument if the three-argument version of the built-in
"pow()" function is to be supported.
Changed in version 3.14.0a7 (unreleased): Three-argument "pow()"
now try calling "__rpow__()" if necessary. Previously it was only
called in two-argument "pow()" and the binary power operator.
Note:
@ -8785,8 +8808,8 @@ object.__or__(self, other)
called. The "__divmod__()" method should be the equivalent to
using "__floordiv__()" and "__mod__()"; it should not be related to
"__truediv__()". Note that "__pow__()" should be defined to accept
an optional third argument if the ternary version of the built-in
"pow()" function is to be supported.
an optional third argument if the three-argument version of the
built-in "pow()" function is to be supported.
If one of those methods does not support the operation with the
supplied arguments, it should return "NotImplemented".
@ -8818,8 +8841,13 @@ object.__ror__(self, other)
called if "type(x).__sub__(x, y)" returns "NotImplemented" or
"type(y)" is a subclass of "type(x)". [5]
Note that ternary "pow()" will not try calling "__rpow__()" (the
coercion rules would become too complicated).
Note that "__rpow__()" should be defined to accept an optional
third argument if the three-argument version of the built-in
"pow()" function is to be supported.
Changed in version 3.14.0a7 (unreleased): Three-argument "pow()"
now try calling "__rpow__()" if necessary. Previously it was only
called in two-argument "pow()" and the binary power operator.
Note:
@ -10100,9 +10128,8 @@ Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.
Changed in version 3.14.0a6 (unreleased): Support for optionally
dropping grouping parentheses when using multiple exception types. See
**PEP 758**.
Changed in version 3.14: Support for optionally dropping grouping
parentheses when using multiple exception types. See **PEP 758**.
"except" clause
@ -10292,9 +10319,9 @@ Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.
Changed in version 3.14.0a6 (unreleased): The compiler emits a
"SyntaxWarning" when a "return", "break" or "continue" appears in a
"finally" block (see **PEP 765**).
Changed in version 3.14: The compiler emits a "SyntaxWarning" when a
"return", "break" or "continue" appears in a "finally" block (see
**PEP 765**).
''',
'types': r'''The standard type hierarchy
***************************
@ -11141,25 +11168,15 @@ Special attributes
| | collected during class body execution. See also: |
| | "__annotations__ attributes". For best practices |
| | on working with "__annotations__", please see |
| | "annotationlib". Caution: Accessing the |
| | "__annotations__" attribute of a class object |
| | directly may yield incorrect results in the |
| | presence of metaclasses. In addition, the |
| | attribute may not exist for some classes. Use |
| | "annotationlib.get_annotations()" to retrieve |
| | class annotations safely. Changed in version |
| | 3.14: Annotations are now lazily evaluated. See |
| | **PEP 649**. |
| | "annotationlib". Where possible, use |
| | "annotationlib.get_annotations()" instead of |
| | accessing this attribute directly. Changed in |
| | version 3.14: Annotations are now lazily |
| | evaluated. See **PEP 649**. |
+----------------------------------------------------+----------------------------------------------------+
| type.__annotate__() | The *annotate function* for this class, or "None" |
| | if the class has no annotations. See also: |
| | "__annotate__ attributes". Caution: Accessing |
| | the "__annotate__" attribute of a class object |
| | directly may yield incorrect results in the |
| | presence of metaclasses. Use |
| | "annotationlib.get_annotate_function()" to |
| | retrieve the annotate function safely. Added in |
| | version 3.14. |
| | "__annotate__ attributes". Added in version 3.14. |
+----------------------------------------------------+----------------------------------------------------+
| type.__type_params__ | A "tuple" containing the type parameters of a |
| | generic class. Added in version 3.12. |
@ -11355,16 +11372,16 @@ the "**keywords" syntax to accept arbitrary keyword arguments; bit
Flags for details on the semantics of each flags that might be
present.
Future feature declarations ("from __future__ import division") also
use bits in "co_flags" to indicate whether a code object was compiled
with a particular feature enabled: bit "0x2000" is set if the function
was compiled with future division enabled; bits "0x10" and "0x1000"
were used in earlier versions of Python.
Future feature declarations (for example, "from __future__ import
division") also use bits in "co_flags" to indicate whether a code
object was compiled with a particular feature enabled. See
"compiler_flag".
Other bits in "co_flags" are reserved for internal use.
If a code object represents a function and has a docstring, the first
item in "co_consts" is the docstring of the function.
If a code object represents a function and has a docstring, the
"CO_HAS_DOCSTRING" bit is set in "co_flags" and the first item in
"co_consts" is the docstring of the function.
Methods on code objects

2112
Misc/NEWS.d/3.14.0b1.rst Normal file

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
Fix use of undefined identifiers in platform triplet detection on MIPS Linux platforms.

View file

@ -1 +0,0 @@
Change the default LTO flags on GCC to not pass ``-flto-partition=none``, and allow parallelization of LTO. For newer GNU makes and GCC, this has a multiple factor speedup for LTO build times, with no noticeable loss in performance.

View file

@ -1,2 +0,0 @@
The :file:`PC\layout` script now allows passing ``--include-tcltk`` on
Windows ARM64.

View file

@ -1 +0,0 @@
Fix building with tail call interpreter and pystats.

View file

@ -1,2 +0,0 @@
Since free-threaded builds do not support the experimental JIT compiler,
prevent these configurations from being combined.

View file

@ -1,2 +0,0 @@
Fix compilation process with ``--enable-optimizations`` and
``--without-docstrings``.

View file

@ -1,2 +0,0 @@
iOS compiler shims now include ``IPHONEOS_DEPLOYMENT_TARGET`` in target
triples, ensuring that SDK version minimums are honored.

View file

@ -1,3 +0,0 @@
Use the cpython-bin-deps "externals" repository for Windows LLVM dependency
management. Installing LLVM manually is no longer necessary for Windows JIT
builds.

View file

@ -1,5 +0,0 @@
Non-tuple sequences are deprecated as argument for the ``(items)`` format
unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing
<arg-parsing>` functions if *items* contains format units which store
a :ref:`borrowed buffer <c-arg-borrowed-buffer>` or
a :term:`borrowed reference`.

View file

@ -1,3 +0,0 @@
Add support of nullable arguments in :c:func:`PyArg_Parse` and similar
functions. Adding ``?`` after any format unit makes ``None`` be accepted as
a value.

View file

@ -1,2 +0,0 @@
Creating a :class:`ctypes.CField` with a *byte_size* that does not match the actual
type size now raises a :exc:`ValueError` instead of crashing the interpreter.

View file

@ -1,3 +0,0 @@
Deprecated and undocumented functions :c:func:`!PyUnicode_AsEncodedObject`,
:c:func:`!PyUnicode_AsDecodedObject`, :c:func:`!PyUnicode_AsEncodedUnicode`
and :c:func:`!PyUnicode_AsDecodedUnicode` are scheduled for removal in 3.15.

View file

@ -1,2 +0,0 @@
Fix an overflow when handling the :ref:`K <capi-py-buildvalue-format-K>` format
in :c:func:`Py_BuildValue`. Patch by Bénédikt Tran.

View file

@ -1,2 +0,0 @@
The ``k`` and ``K`` formats in :c:func:`PyArg_Parse` now support the
:meth:`~object.__index__` special method, like all other integer formats.

View file

@ -1,3 +0,0 @@
The undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and
:c:member:`!PyThreadState.c_recursion_remaining`, added in 3.13, are removed
without a deprecation period.

View file

@ -1,3 +0,0 @@
For non-free-threaded builds, the memory layout of :c:struct:`PyASCIIObject`
is reverted to match Python 3.13. (Note that the structure is not part of
stable ABI and so its memory layout is *guaranteed* to remain stable.)

View file

@ -1,4 +0,0 @@
On non-Windows platforms, deprecate using :attr:`ctypes.Structure._pack_` to
use a Windows-compatible layout on non-Windows platforms. The layout should
be specified explicitly by setting :attr:`ctypes.Structure._layout_` to
``'ms'``.

View file

@ -1,3 +0,0 @@
Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for
``Py_REFNCT(op) == 1`` on :term:`free threaded <free threading>`
builds of Python.

View file

@ -1,5 +0,0 @@
Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` function for
determining if an object exists as a unique temporary variable on the
interpreter's stack. This is a replacement for some cases where checking
that :c:func:`Py_REFCNT` is one is no longer sufficient to determine if it's
safe to modify a Python object in-place with no visible side effects.

View file

@ -1,2 +0,0 @@
Fix regression where :c:func:`PyType_GetModuleByDef` returns NULL without
setting :exc:`TypeError` when a static type is passed.

View file

@ -1 +0,0 @@
Remove ``hostflags`` member from ``PySSLContext`` struct.

View file

@ -1,4 +0,0 @@
String arguments passed to "-c" are now automatically dedented as if by
:func:`textwrap.dedent`. This allows "python -c" invocations to be indented
in shell scripts without causing indentation errors. (Patch by Jon Crall and
Steven Sun)

View file

@ -1 +0,0 @@
Improve error message when :exc:`TypeError` occurs during :meth:`dict.update`

View file

@ -1,4 +0,0 @@
:option:`-X importtime <-X>` now accepts value ``2``, which indicates that
an ``importtime`` entry should also be printed if an imported module has
already been loaded.
Patch by Noah Kim and Adam Turner.

View file

@ -1,2 +0,0 @@
Improve :exc:`SyntaxError` message for using ``import ... as``
and ``from ... import ... as`` with not a name.

View file

@ -1,16 +0,0 @@
Add the :data:`sys.flags.thread_inherit_context` flag.
* This flag is set to true by default on the free-threaded build
and false otherwise. If the flag is true, starting a new thread using
:class:`threading.Thread` will, by default, use a copy of the
:class:`contextvars.Context` from the caller of
:meth:`threading.Thread.start` rather than using an empty context.
* Add the :option:`-X thread_inherit_context <-X>` command-line option and
:envvar:`PYTHON_THREAD_INHERIT_CONTEXT` environment variable, which set the
:data:`~sys.flags.thread_inherit_context` flag.
* Add the ``context`` keyword parameter to :class:`~threading.Thread`. It can
be used to explicitly pass a context value to be used by a new thread.
* Make the ``_contextvars`` module built-in.

View file

@ -1 +0,0 @@
Add module autocomplete to PyREPL.

View file

@ -1 +0,0 @@
``elif`` statements that follow an ``else`` block now have a specific error message.

View file

@ -1,2 +0,0 @@
Fix a bug that was allowing newlines inconsitently in format specifiers for
single-quoted f-strings. Patch by Pablo Galindo.

View file

@ -1 +0,0 @@
Fixed an assertion error for :func:`exec` passed a string ``source`` and a non-``None`` ``closure``. Patch by Bartosz Sławecki.

View file

@ -1,4 +0,0 @@
Three-argument :func:`pow` now try calling :meth:`~object.__rpow__` if
necessary.
Previously it was only called in two-argument :func:`!pow` and the binary
power operator.

View file

@ -1,3 +0,0 @@
If the ``__annotations__`` of a module object are accessed while the
module is executing, return the annotations that have been defined so far,
without caching them.

View file

@ -1 +0,0 @@
PyREPL now supports syntax highlighing. Contributed by Łukasz Langa.

View file

@ -1 +0,0 @@
Add support for macOS multi-arch builds with the JIT enabled

View file

@ -1,3 +0,0 @@
Move constant folding to the peephole optimizer. Rename AST optimization
related files (Python/ast_opt.c -> Python/ast_preprocess.c), structs (_PyASTOptimizeState -> _PyASTPreprocessState)
and functions (_PyAST_Optimize -> _PyAST_Preprocess, _PyCompile_AstOptimize -> _PyCompile_AstPreprocess).

View file

@ -1,2 +0,0 @@
Fix support of unicode characters with two or more codepoints on Windows in
the new REPL.

View file

@ -1 +0,0 @@
Handle uncaught exceptions in the main input loop for the new REPL.

View file

@ -1,2 +0,0 @@
Allow the JIT to remove unicode guards after ``_BINARY_OP_SUBSCR_STR_INT``
by setting the return type to string.

View file

@ -1,4 +0,0 @@
Improve error message when an object supporting the synchronous (resp.
asynchronous) context manager protocol is entered using :keyword:`async
with` (resp. :keyword:`with`) instead of :keyword:`with` (resp.
:keyword:`async with`). Patch by Bénédikt Tran.

View file

@ -1,2 +0,0 @@
Allow the JIT compiler to remove some type checks for operations on lists,
tuples, dictionaries, and sets.

View file

@ -1,3 +0,0 @@
Prevents against stack overflows when calling :c:func:`Py_DECREF`. Third-party
extension objects no longer need to use the "trashcan" mechanism, as
protection is now built into the :c:func:`Py_DECREF` macro.

View file

@ -1,2 +0,0 @@
Allow the JIT to remove an extra ``_TO_BOOL_BOOL`` instruction after
``_CONTAINS_OP_DICT`` by setting the return type to bool.

View file

@ -1,2 +0,0 @@
Fix that :attr:`type.__annotate__` was not deleted, when
:attr:`type.__annotations__` was deleted.

View file

@ -1 +0,0 @@
Fix possible use after free in cases where a method's definition has the same lifetime as its ``self``.

View file

@ -1,3 +0,0 @@
Improve the JIT's ability to remove unused constant and local variable
loads, and fix an issue where deallocating unused values could cause JIT
code to crash or behave incorrectly.

View file

@ -1 +0,0 @@
Don't wrap base ``PyCFunction`` slots on class creation if not overridden.

View file

@ -1,4 +0,0 @@
The internal storage for annotations and annotate functions on classes now
uses different keys in the class dictionary. This eliminates various edge
cases where access to the ``__annotate__`` and ``__annotations__``
attributes would behave unpredictably.

View file

@ -1,4 +0,0 @@
No longer call ``__iter__`` twice when creating and executing a generator expression.
Creating a generator expression from a non-interable will raise only when the
generator expression is executed.
This brings the behavior of generator expressions in line with other generators.

View file

@ -1,2 +0,0 @@
Fix crash when passing a dict subclass as the ``globals`` parameter to
:func:`exec`.

View file

@ -1,2 +0,0 @@
Split ``CALL_TYPE_1`` into several uops allowing the JIT to remove some of
them.

View file

@ -1,2 +0,0 @@
Use ``sym_new_type`` instead of ``sym_new_not_null`` for _BUILD_LIST,
_BUILD_SET, _BUILD_MAP

View file

@ -1 +0,0 @@
Make :func:`staticmethod` and :func:`classmethod` generic.

View file

@ -1,3 +0,0 @@
Compiler warnings originating from the same module and line number are now
only emitted once, matching the behaviour of warnings emitted from user
code. This can also be configured with :mod:`warnings` filters.

View file

@ -1 +0,0 @@
Fix decoding from the locale encoding in the C.UTF-8 locale.

View file

@ -1,3 +0,0 @@
Uses tagged integers on the evaluation stack to represent the instruction
offsets when reraising an exception. This avoids the need to box the integer
which could fail in low memory conditions.

View file

@ -1 +0,0 @@
Add specialisation for ``BINARY_OP/SUBSCR`` on list and slice.

View file

@ -1,2 +0,0 @@
Added :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes` and
:c:func:`PyLong_FromUnsignedNativeBytes` to the limited C API.

View file

@ -1 +0,0 @@
Support profiling code that requires ``__main__``, such as :mod:`pickle`.

View file

@ -1,2 +0,0 @@
Syntax errors that look like misspellings of Python keywords now provide a
helpful fix suggestion for the typo. Contributed by Pablo Galindo Salgado.

View file

@ -1 +0,0 @@
Certain calls now check for runaway recursion and respect the system recursion limit.

View file

@ -1,2 +0,0 @@
Fix a crash when calling :meth:`~object.__get__` of a :term:`method` with a
:const:`None` second argument.

View file

@ -1,2 +0,0 @@
Fix compiler crash in certain circumstances where multiple module-level
annotations include comprehensions and other nested scopes.

View file

@ -1,3 +0,0 @@
Implement :pep:`750` (Template Strings). Add new syntax for t-strings and
implement new internal :class:`!string.templatelib.Template` and
:class:`!string.templatelib.Interpolation` types.

View file

@ -1,2 +0,0 @@
Fix ``repr(list)`` race condition: hold a strong reference to the item while
calling ``repr(item)``. Patch by Victor Stinner.

View file

@ -1 +0,0 @@
Reset any :pep:`768` remote debugging pending call in children after :func:`os.fork` calls.

View file

@ -1,2 +0,0 @@
Enhance unhashable key/element error messages for :class:`dict` and
:class:`set`. Patch by Victor Stinner.

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