Skip to content

Commit

Permalink
Merge branch 'main' into writer_hamt
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Oct 15, 2024
2 parents 3cc9e8c + 546dddc commit 6f7813a
Show file tree
Hide file tree
Showing 49 changed files with 523 additions and 299 deletions.
14 changes: 4 additions & 10 deletions Doc/c-api/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,10 @@ Context object management functions:
Enumeration of possible context object watcher events:
- ``Py_CONTEXT_EVENT_ENTER``: A context has been entered, causing the
:term:`current context` to switch to it. The object passed to the watch
callback is the now-current :class:`contextvars.Context` object. Each
enter event will eventually have a corresponding exit event for the same
context object after any subsequently entered contexts have themselves been
exited.
- ``Py_CONTEXT_EVENT_EXIT``: A context is about to be exited, which will
cause the :term:`current context` to switch back to what it was before the
context was entered. The object passed to the watch callback is the
still-current :class:`contextvars.Context` object.
- ``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a
different context. The object passed to the watch callback is the
now-current :class:`contextvars.Context` object, or None if no context is
current.
.. versionadded:: 3.14
Expand Down
2 changes: 2 additions & 0 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,8 @@ Create Config
Free memory of the initialization configuration *config*.
If *config* is ``NULL``, no operation is performed.
Error Handling
--------------
Expand Down
2 changes: 1 addition & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
# Sphinx 8.1 has in-built CVE and CWE roles.
extlinks |= {
"cve": (
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s",
"https://www.cve.org/CVERecord?id=CVE-%s",
"CVE-%s",
),
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.14
Pending removal in Python 3.14
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.15
Pending removal in Python 3.15
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The bundled copy of ``libmpdecimal``.
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-future.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Future Versions
Pending removal in future versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following APIs are deprecated and will be removed,
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deprecations

.. include:: pending-removal-in-future.rst

C API Deprecations
C API deprecations
------------------

.. include:: c-api-pending-removal-in-3.15.rst
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.13.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.13
Pending removal in Python 3.13
------------------------------

Modules (see :pep:`594`):
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.14
Pending removal in Python 3.14
------------------------------

* The import system:
Expand Down
4 changes: 2 additions & 2 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.15
Pending removal in Python 3.15
------------------------------

* The import system:
Expand Down Expand Up @@ -63,7 +63,7 @@ Pending Removal in Python 3.15

* The undocumented keyword argument syntax for creating
:class:`~typing.NamedTuple` classes
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``)
(for example, ``Point = NamedTuple("Point", x=int, y=int)``)
has been deprecated since Python 3.13.
Use the class-based syntax or the functional syntax instead.

Expand Down
29 changes: 14 additions & 15 deletions Doc/deprecations/pending-removal-in-3.16.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
Pending Removal in Python 3.16
Pending removal in Python 3.16
------------------------------

* :mod:`builtins`:

* Bitwise inversion on boolean types, ``~True`` or ``~False``
has been deprecated since Python 3.12,
as it produces surprising and unintuitive results (``-2`` and ``-1``).
Use ``not x`` instead for the logical negation of a Boolean.
In the rare case that you need the bitwise inversion of
the underlying integer, convert to ``int`` explicitly (``~int(x)``).

* :mod:`array`:

* The ``'u'`` format code (:c:type:`wchar_t`)
Expand All @@ -20,11 +11,19 @@ Pending Removal in Python 3.16

* :mod:`asyncio`:

* :mod:`asyncio`:
:func:`!asyncio.iscoroutinefunction` is deprecated
and will be removed in Python 3.16,
use :func:`inspect.iscoroutinefunction` instead.
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
* :func:`!asyncio.iscoroutinefunction` is deprecated
and will be removed in Python 3.16,
use :func:`inspect.iscoroutinefunction` instead.
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)

* :mod:`builtins`:

* Bitwise inversion on boolean types, ``~True`` or ``~False``
has been deprecated since Python 3.12,
as it produces surprising and unintuitive results (``-2`` and ``-1``).
Use ``not x`` instead for the logical negation of a Boolean.
In the rare case that you need the bitwise inversion of
the underlying integer, convert to ``int`` explicitly (``~int(x)``).

* :mod:`shutil`:

Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-future.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Future Versions
Pending removal in future versions
----------------------------------

The following APIs will be removed in the future,
Expand Down
34 changes: 17 additions & 17 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@ Objects of the :class:`date` type are always naive.

An object of type :class:`.time` or :class:`.datetime` may be aware or naive.

A :class:`.datetime` object *d* is aware if both of the following hold:
A :class:`.datetime` object ``d`` is aware if both of the following hold:

1. ``d.tzinfo`` is not ``None``
2. ``d.tzinfo.utcoffset(d)`` does not return ``None``

Otherwise, *d* is naive.
Otherwise, ``d`` is naive.

A :class:`.time` object *t* is aware if both of the following hold:
A :class:`.time` object ``t`` is aware if both of the following hold:

1. ``t.tzinfo`` is not ``None``
2. ``t.tzinfo.utcoffset(None)`` does not return ``None``.

Otherwise, *t* is naive.
Otherwise, ``t`` is naive.

The distinction between aware and naive doesn't apply to :class:`timedelta`
objects.
Expand Down Expand Up @@ -358,8 +358,8 @@ Supported operations:
+--------------------------------+-----------------------------------------------+
| ``q, r = divmod(t1, t2)`` | Computes the quotient and the remainder: |
| | ``q = t1 // t2`` (3) and ``r = t1 % t2``. |
| | q is an integer and r is a :class:`timedelta` |
| | object. |
| | ``q`` is an integer and ``r`` is a |
| | :class:`timedelta` object. |
+--------------------------------+-----------------------------------------------+
| ``+t1`` | Returns a :class:`timedelta` object with the |
| | same value. (2) |
Expand Down Expand Up @@ -526,7 +526,7 @@ Other constructors, all class methods:
January 1 of year 1 has ordinal 1.

:exc:`ValueError` is raised unless ``1 <= ordinal <=
date.max.toordinal()``. For any date *d*,
date.max.toordinal()``. For any date ``d``,
``date.fromordinal(d.toordinal()) == d``.


Expand Down Expand Up @@ -730,7 +730,7 @@ Instance methods:
.. method:: date.toordinal()

Return the proleptic Gregorian ordinal of the date, where January 1 of year 1
has ordinal 1. For any :class:`date` object *d*,
has ordinal 1. For any :class:`date` object ``d``,
``date.fromordinal(d.toordinal()) == d``.


Expand Down Expand Up @@ -782,7 +782,7 @@ Instance methods:

.. method:: date.__str__()

For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``.
For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``.


.. method:: date.ctime()
Expand Down Expand Up @@ -1063,7 +1063,7 @@ Other constructors, all class methods:
is used. If the *date* argument is a :class:`.datetime` object, its time components
and :attr:`.tzinfo` attributes are ignored.

For any :class:`.datetime` object *d*,
For any :class:`.datetime` object ``d``,
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``.

.. versionchanged:: 3.6
Expand Down Expand Up @@ -1270,11 +1270,11 @@ Supported operations:

If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute,
the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta`
object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments
object ``t`` such that ``datetime2 + t == datetime1``. No time zone adjustments
are done in this case.

If both are aware and have different :attr:`~.datetime.tzinfo` attributes, ``a-b`` acts
as if *a* and *b* were first converted to naive UTC datetimes. The
as if ``a`` and ``b`` were first converted to naive UTC datetimes. The
result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None)
- b.utcoffset())`` except that the implementation never overflows.

Expand Down Expand Up @@ -1454,11 +1454,11 @@ Instance methods:

.. method:: datetime.utctimetuple()

If :class:`.datetime` instance *d* is naive, this is the same as
If :class:`.datetime` instance ``d`` is naive, this is the same as
``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what
``d.dst()`` returns. DST is never in effect for a UTC time.

If *d* is aware, *d* is normalized to UTC time, by subtracting
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
``d.utcoffset()``, and a :class:`time.struct_time` for the
normalized time is returned. :attr:`!tm_isdst` is forced to 0. Note
that an :exc:`OverflowError` may be raised if ``d.year`` was
Expand Down Expand Up @@ -1606,7 +1606,7 @@ Instance methods:

.. method:: datetime.__str__()

For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to
For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to
``d.isoformat(' ')``.


Expand Down Expand Up @@ -1853,7 +1853,7 @@ Instance attributes (read-only):
.. versionadded:: 3.6

:class:`.time` objects support equality and order comparisons,
where *a* is considered less than *b* when *a* precedes *b* in time.
where ``a`` is considered less than ``b`` when ``a`` precedes ``b`` in time.

Naive and aware :class:`!time` objects are never equal.
Order comparison between naive and aware :class:`!time` objects raises
Expand Down Expand Up @@ -2000,7 +2000,7 @@ Instance methods:

.. method:: time.__str__()

For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``.
For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``.


.. method:: time.strftime(format)
Expand Down
5 changes: 2 additions & 3 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,10 @@ UAX-31, with elaboration and changes as defined below; see also :pep:`3131` for
further details.

Within the ASCII range (U+0001..U+007F), the valid characters for identifiers
are the same as in Python 2.x: the uppercase and lowercase letters ``A`` through
include the uppercase and lowercase letters ``A`` through
``Z``, the underscore ``_`` and, except for the first character, the digits
``0`` through ``9``.

Python 3.0 introduces additional characters from outside the ASCII range (see
Python 3.0 introduced additional characters from outside the ASCII range (see
:pep:`3131`). For these characters, the classification uses the version of the
Unicode Character Database as included in the :mod:`unicodedata` module.

Expand Down
4 changes: 2 additions & 2 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Features and minimum versions required to build CPython:

* Tcl/Tk 8.5.12 for the :mod:`tkinter` module.

* Autoconf 2.71 and aclocal 1.16.4 are required to regenerate the
* Autoconf 2.71 and aclocal 1.16.5 are required to regenerate the
:file:`configure` script.

.. versionchanged:: 3.1
Expand All @@ -56,7 +56,7 @@ Features and minimum versions required to build CPython:
Tcl/Tk version 8.5.12 is now required for the :mod:`tkinter` module.

.. versionchanged:: 3.13
Autoconf 2.71, aclocal 1.16.4 and SQLite 3.15.2 are now required.
Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required.

See also :pep:`7` "Style Guide for C Code" and :pep:`11` "CPython platform
support".
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2495,9 +2495,9 @@ Build Changes
* Building CPython now requires a compiler with support for the C11 atomic
library, GCC built-in atomic functions, or MSVC interlocked intrinsics.

* Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate
* Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate
the :file:`configure` script.
(Contributed by Christian Heimes in :gh:`89886`.)
(Contributed by Christian Heimes in :gh:`89886` and by Victor Stinner in :gh:`112090`.)

* SQLite 3.15.2 or newer is required to build
the :mod:`sqlite3` extension module.
Expand Down
Loading

0 comments on commit 6f7813a

Please sign in to comment.