Skip to content

Commit

Permalink
Merge branch 'main' into clinic-var-positional
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 6, 2024
2 parents d96bb25 + 7587260 commit ba8f9c2
Show file tree
Hide file tree
Showing 188 changed files with 4,475 additions and 1,300 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ Objects/exceptions.c @iritkatriel
**/sha* @gpshead @tiran
Modules/md5* @gpshead @tiran
**/*blake* @gpshead @tiran
Modules/_blake2/** @gpshead @tiran
Modules/_hacl/** @gpshead

# logging
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
jobs:
interpreter:
name: Interpreter (Debug)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -85,19 +85,19 @@ jobs:
compiler: clang
- target: x86_64-unknown-linux-gnu/gcc
architecture: x86_64
runner: ubuntu-latest
runner: ubuntu-22.04
compiler: gcc
- target: x86_64-unknown-linux-gnu/clang
architecture: x86_64
runner: ubuntu-latest
runner: ubuntu-22.04
compiler: clang
- target: aarch64-unknown-linux-gnu/gcc
architecture: aarch64
runner: ubuntu-latest
runner: ubuntu-22.04
compiler: gcc
- target: aarch64-unknown-linux-gnu/clang
architecture: aarch64
runner: ubuntu-latest
runner: ubuntu-22.04
compiler: clang
env:
CC: ${{ matrix.compiler }}
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
jit-with-disabled-gil:
name: Free-Threaded (Debug)
needs: interpreter
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
llvm:
Expand Down
6 changes: 2 additions & 4 deletions Doc/c-api/allocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ Allocating Objects on the Heap
.. c:function:: PyObject* PyObject_Init(PyObject *op, PyTypeObject *type)
Initialize a newly allocated object *op* with its type and initial
reference. Returns the initialized object. If *type* indicates that the
object participates in the cyclic garbage detector, it is added to the
detector's set of observed objects. Other fields of the object are not
affected.
reference. Returns the initialized object. Other fields of the object are
not affected.
.. c:function:: PyVarObject* PyObject_InitVar(PyVarObject *op, PyTypeObject *type, Py_ssize_t size)
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/conversion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The following functions provide locale-independent string to number conversions.
If ``s`` represents a value that is too large to store in a float
(for example, ``"1e500"`` is such a string on many platforms) then
if ``overflow_exception`` is ``NULL`` return ``Py_HUGE_VAL`` (with
if ``overflow_exception`` is ``NULL`` return ``Py_INFINITY`` (with
an appropriate sign) and don't set any exception. Otherwise,
``overflow_exception`` must point to a Python exception object;
raise that exception and return ``-1.0``. In both cases, set
Expand Down
12 changes: 1 addition & 11 deletions Doc/deprecations/pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Pending removal in Python 3.14
:meth:`~pathlib.PurePath.relative_to`: passing additional arguments is
deprecated.

* :mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader`
* :mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:!pkgutil.get_loader`
now raise :exc:`DeprecationWarning`;
use :func:`importlib.util.find_spec` instead.
(Contributed by Nikita Sobolev in :gh:`97850`.)
Expand All @@ -103,16 +103,6 @@ Pending removal in Python 3.14
if :ref:`named placeholders <sqlite3-placeholders>` are used and
*parameters* is a sequence instead of a :class:`dict`.

* date and datetime adapter, date and timestamp converter:
see the :mod:`sqlite3` documentation for suggested replacement recipes.

* :class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was
deprecated in :pep:`626`
since 3.10 and was planned to be removed in 3.12,
but it only got a proper :exc:`DeprecationWarning` in 3.12.
May be removed in 3.14.
(Contributed by Nikita Sobolev in :gh:`101866`.)

* :mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9,
now causes a :exc:`DeprecationWarning` to be emitted when it is used.

Expand Down
9 changes: 9 additions & 0 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ Pending removal in Python 3.15
but the C version allows any number of positional or keyword arguments,
ignoring every argument.

* :mod:`types`:

* :class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was
deprecated in :pep:`626`
since 3.10 and was planned to be removed in 3.12,
but it only got a proper :exc:`DeprecationWarning` in 3.12.
May be removed in 3.15.
(Contributed by Nikita Sobolev in :gh:`101866`.)

* :mod:`typing`:

* The undocumented keyword argument syntax for creating
Expand Down
5 changes: 2 additions & 3 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ an event loop:
instead of using these lower level functions to manually create and close an
event loop.

.. deprecated:: 3.12
Deprecation warning is emitted if there is no current event loop.
In some future Python release this will become an error.
.. versionchanged:: 3.14
Raises a :exc:`RuntimeError` if there is no current event loop.

.. function:: set_event_loop(loop)

Expand Down
8 changes: 3 additions & 5 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ asyncio ships with the following built-in policies:

On Windows, :class:`ProactorEventLoop` is now used by default.

.. deprecated:: 3.12
The :meth:`get_event_loop` method of the default asyncio policy now emits
a :exc:`DeprecationWarning` if there is no current event loop set and it
decides to create one.
In some future Python release this will become an error.
.. versionchanged:: 3.14
The :meth:`get_event_loop` method of the default asyncio policy now
raises a :exc:`RuntimeError` if there is no set event loop.


.. class:: WindowsSelectorEventLoopPolicy
Expand Down
18 changes: 10 additions & 8 deletions Doc/library/cmath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,21 @@ Classification functions
``False`` otherwise.

Whether or not two values are considered close is determined according to
given absolute and relative tolerances.
given absolute and relative tolerances. If no errors occur, the result will
be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``.

*rel_tol* is the relative tolerance -- it is the maximum allowed difference
between *a* and *b*, relative to the larger absolute value of *a* or *b*.
For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default
tolerance is ``1e-09``, which assures that the two values are the same
within about 9 decimal digits. *rel_tol* must be greater than zero.

*abs_tol* is the minimum absolute tolerance -- useful for comparisons near
zero. *abs_tol* must be at least zero.

If no errors occur, the result will be:
``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``.
within about 9 decimal digits. *rel_tol* must be nonnegative and less
than ``1.0``.

*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be
nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed
as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and
rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument
to the call.

The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be
handled according to IEEE rules. Specifically, ``NaN`` is not considered
Expand Down
31 changes: 28 additions & 3 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,13 @@ interpolation if an option used is not defined elsewhere. ::
ConfigParser Objects
--------------------

.. class:: ConfigParser(defaults=None, dict_type=dict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation(), converters={})
.. class:: ConfigParser(defaults=None, dict_type=dict, allow_no_value=False, *, \
delimiters=('=', ':'), comment_prefixes=('#', ';'), \
inline_comment_prefixes=None, strict=True, \
empty_lines_in_values=True, \
default_section=configparser.DEFAULTSECT, \
interpolation=BasicInterpolation(), converters={}, \
allow_unnamed_section=False)

The main configuration parser. When *defaults* is given, it is initialized
into the dictionary of intrinsic defaults. When *dict_type* is given, it
Expand Down Expand Up @@ -990,6 +996,10 @@ ConfigParser Objects
converter gets its own corresponding :meth:`!get*` method on the parser
object and section proxies.

When *allow_unnamed_section* is ``True`` (default: ``False``),
the first section name can be omitted. See the
`"Unnamed Sections" section <#unnamed-sections>`_.

It is possible to read several configurations into a single
:class:`ConfigParser`, where the most recently added configuration has the
highest priority. Any conflicting keys are taken from the more recent
Expand Down Expand Up @@ -1039,6 +1049,9 @@ ConfigParser Objects
Raise a :exc:`MultilineContinuationError` when *allow_no_value* is
``True``, and a key without a value is continued with an indented line.

.. versionchanged:: 3.13
The *allow_unnamed_section* argument was added.

.. method:: defaults()

Return a dictionary containing the instance-wide defaults.
Expand Down Expand Up @@ -1295,18 +1308,30 @@ RawConfigParser Objects
comment_prefixes=('#', ';'), \
inline_comment_prefixes=None, strict=True, \
empty_lines_in_values=True, \
default_section=configparser.DEFAULTSECT[, \
interpolation])
default_section=configparser.DEFAULTSECT, \
interpolation=BasicInterpolation(), converters={}, \
allow_unnamed_section=False)
Legacy variant of the :class:`ConfigParser`. It has interpolation
disabled by default and allows for non-string section names, option
names, and values via its unsafe ``add_section`` and ``set`` methods,
as well as the legacy ``defaults=`` keyword argument handling.

.. versionchanged:: 3.2
*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*,
*empty_lines_in_values*, *default_section* and *interpolation* were
added.

.. versionchanged:: 3.5
The *converters* argument was added.

.. versionchanged:: 3.8
The default *dict_type* is :class:`dict`, since it now preserves
insertion order.

.. versionchanged:: 3.13
The *allow_unnamed_section* argument was added.

.. note::
Consider using :class:`ConfigParser` instead which checks types of
the values to be stored internally. If you don't want interpolation, you
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ iterations of the loop.

.. opcode:: MAKE_FUNCTION

Pushes a new function object on the stack built from the code object at ``STACK[1]``.
Pushes a new function object on the stack built from the code object at ``STACK[-1]``.

.. versionchanged:: 3.10
Flag value ``0x04`` is a tuple of strings instead of dictionary
Expand Down Expand Up @@ -1647,7 +1647,7 @@ iterations of the loop.

.. versionadded:: 3.13

.. opcode:: FORMAT_SPEC
.. opcode:: FORMAT_WITH_SPEC

Formats the given value with the given format spec::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using function-call syntax::
... BLUE = 3

>>> # functional syntax
>>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])
>>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])

Even though we can use :keyword:`class` syntax to create Enums, Enums
are not normal Python classes. See
Expand Down
11 changes: 8 additions & 3 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1205,14 +1205,19 @@ are always available. They are listed here in alphabetical order.
unchanged from previous versions.


.. function:: map(function, iterable, *iterables)
.. function:: map(function, iterable, /, *iterables, strict=False)

Return an iterator that applies *function* to every item of *iterable*,
yielding the results. If additional *iterables* arguments are passed,
*function* must take that many arguments and is applied to the items from all
iterables in parallel. With multiple iterables, the iterator stops when the
shortest iterable is exhausted. For cases where the function inputs are
already arranged into argument tuples, see :func:`itertools.starmap`\.
shortest iterable is exhausted. If *strict* is ``True`` and one of the
iterables is exhausted before the others, a :exc:`ValueError` is raised. For
cases where the function inputs are already arranged into argument tuples,
see :func:`itertools.starmap`.

.. versionchanged:: 3.14
Added the *strict* parameter.


.. function:: max(iterable, *, key=None)
Expand Down
12 changes: 10 additions & 2 deletions Doc/library/getopt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ exception:

An example using only Unix style options:

.. doctest::

>>> import getopt
>>> args = '-a -b -cfoo -d bar a1 a2'.split()
>>> args
Expand All @@ -109,6 +111,8 @@ An example using only Unix style options:

Using long option names is equally easy:

.. doctest::

>>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
>>> args = s.split()
>>> args
Expand All @@ -120,7 +124,9 @@ Using long option names is equally easy:
>>> args
['a1', 'a2']

In a script, typical usage is something like this::
In a script, typical usage is something like this:

.. testcode::

import getopt, sys

Expand Down Expand Up @@ -150,7 +156,9 @@ In a script, typical usage is something like this::
main()

Note that an equivalent command line interface could be produced with less code
and more informative help and error messages by using the :mod:`argparse` module::
and more informative help and error messages by using the :mod:`argparse` module:

.. testcode::

import argparse

Expand Down
Loading

0 comments on commit ba8f9c2

Please sign in to comment.