Skip to content

Commit 0427f01

Browse files
committed
Merge branch 'main' into gh-140795-ssl-exc
2 parents 8cd4d98 + e535bdb commit 0427f01

File tree

170 files changed

+5259
-2391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+5259
-2391
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ Misc/externals.spdx.json @sethmlarson
143143
Misc/sbom.spdx.json @sethmlarson
144144
Tools/build/generate_sbom.py @sethmlarson
145145

146+
# ABI check
147+
Misc/libabigail.abignore @encukou
148+
146149

147150
# ----------------------------------------------------------------------------
148151
# Platform Support

Doc/c-api/apiabiversion.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
3434
This can be ``0xA`` for alpha, ``0xB`` for beta, ``0xC`` for release
3535
candidate or ``0xF`` for final.
3636

37+
38+
.. c:namespace:: NULL
39+
.. c:macro:: PY_RELEASE_LEVEL_ALPHA
40+
:no-typesetting:
41+
.. c:macro:: PY_RELEASE_LEVEL_BETA
42+
:no-typesetting:
43+
.. c:macro:: PY_RELEASE_LEVEL_GAMMA
44+
:no-typesetting:
45+
.. c:macro:: PY_RELEASE_LEVEL_FINAL
46+
:no-typesetting:
47+
48+
For completeness, the values are available as macros:
49+
:c:macro:`!PY_RELEASE_LEVEL_ALPHA` (``0xA``),
50+
:c:macro:`!PY_RELEASE_LEVEL_BETA` (``0xB``),
51+
:c:macro:`!PY_RELEASE_LEVEL_GAMMA` (``0xC``), and
52+
:c:macro:`!PY_RELEASE_LEVEL_FINAL` (``0xF``).
53+
3754
.. c:macro:: PY_RELEASE_SERIAL
3855
3956
The ``2`` in ``3.4.1a2``. Zero for final releases.
@@ -46,6 +63,12 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
4663
Use this for numeric comparisons, for example,
4764
``#if PY_VERSION_HEX >= ...``.
4865

66+
.. c:macro:: PY_VERSION
67+
68+
The Python version as a string, for example, ``"3.4.1a2"``.
69+
70+
These macros are defined in :source:`Include/patchlevel.h`.
71+
4972

5073
Run-time version
5174
----------------

Doc/c-api/module.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,18 @@ struct:
820820
.. versionadded:: 3.5
821821
822822
.. c:macro:: PYTHON_API_VERSION
823+
PYTHON_API_STRING
823824
824-
The C API version. Defined for backwards compatibility.
825+
The C API version, as an integer (``1013``) and string (``"1013"``), respectively.
826+
Defined for backwards compatibility.
825827
826828
Currently, this constant is not updated in new Python versions, and is not
827829
useful for versioning. This may change in the future.
828830
829831
.. c:macro:: PYTHON_ABI_VERSION
832+
PYTHON_ABI_STRING
830833
831-
Defined as ``3`` for backwards compatibility.
834+
Defined as ``3`` and ``"3"``, respectively, for backwards compatibility.
832835
833836
Currently, this constant is not updated in new Python versions, and is not
834837
useful for versioning. This may change in the future.

Doc/c-api/unicode.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,27 @@ Python:
6565
.. versionadded:: 3.3
6666

6767

68+
The structure of a particular object can be determined using the following
69+
macros.
70+
The macros cannot fail; their behavior is undefined if their argument
71+
is not a Python Unicode object.
72+
73+
.. c:namespace:: NULL
74+
75+
.. c:macro:: PyUnicode_IS_COMPACT(o)
76+
77+
True if *o* uses the :c:struct:`PyCompactUnicodeObject` structure.
78+
79+
.. versionadded:: 3.3
80+
81+
82+
.. c:macro:: PyUnicode_IS_COMPACT_ASCII(o)
83+
84+
True if *o* uses the :c:struct:`PyASCIIObject` structure.
85+
86+
.. versionadded:: 3.3
87+
88+
6889
The following APIs are C macros and static inlined functions for fast checks and
6990
access to internal read-only data of Unicode objects:
7091

Doc/library/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
--------------
1010

1111
This module defines an object type which can compactly represent an array of
12-
basic values: characters, integers, floating-point numbers. Arrays are sequence
12+
basic values: characters, integers, floating-point numbers. Arrays are mutable :term:`sequence`
1313
types and behave very much like lists, except that the type of objects stored in
1414
them is constrained. The type is specified at object creation time by using a
1515
:dfn:`type code`, which is a single character. The following type codes are
@@ -93,7 +93,7 @@ The module defines the following type:
9393
otherwise, the initializer's iterator is passed to the :meth:`extend` method
9494
to add initial items to the array.
9595

96-
Array objects support the ordinary sequence operations of indexing, slicing,
96+
Array objects support the ordinary :ref:`mutable <typesseq-mutable>` :term:`sequence` operations of indexing, slicing,
9797
concatenation, and multiplication. When using slice assignment, the assigned
9898
value must be an array object with the same type code; in all other cases,
9999
:exc:`TypeError` is raised. Array objects also implement the buffer interface,

Doc/library/concurrent.futures.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ or separate processes, using :class:`ProcessPoolExecutor`.
2121
Each implements the same interface, which is defined
2222
by the abstract :class:`Executor` class.
2323

24+
:class:`concurrent.futures.Future` must not be confused with
25+
:class:`asyncio.Future`, which is designed for use with :mod:`asyncio`
26+
tasks and coroutines. See the :doc:`asyncio's Future <asyncio-future>`
27+
documentation for a detailed comparison of the two.
28+
2429
.. include:: ../includes/wasm-notavail.rst
2530

2631
Executor Objects

Doc/library/dis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ not have to be) the original ``STACK[-2]``.
768768
end = STACK.pop()
769769
start = STACK.pop()
770770
container = STACK.pop()
771-
values = STACK.pop()
771+
value = STACK.pop()
772772
container[start:end] = value
773773

774774
.. versionadded:: 3.12

Doc/library/email.message.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ message objects.
5757
:class:`~email.policy.default` policy, which follows the rules of the email
5858
RFCs except for line endings (instead of the RFC mandated ``\r\n``, it uses
5959
the Python standard ``\n`` line endings). For more information see the
60-
:mod:`~email.policy` documentation.
60+
:mod:`~email.policy` documentation. [2]_
6161

6262
.. method:: as_string(unixfrom=False, maxheaderlen=None, policy=None)
6363

@@ -749,3 +749,9 @@ message objects.
749749
.. [1] Originally added in 3.4 as a :term:`provisional module <provisional
750750
package>`. Docs for legacy message class moved to
751751
:ref:`compat32_message`.
752+
753+
.. [2] The :class:`EmailMessage` class requires a policy that provides a
754+
``content_manager`` attribute for content management methods like
755+
``set_content()`` and ``get_content()`` to work. The legacy
756+
:const:`~email.policy.compat32` policy does not support these methods
757+
and should not be used with :class:`EmailMessage`.

Doc/library/email.policy.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@ The header objects and their attributes are described in
662662
An instance of :class:`Compat32`, providing backward compatibility with the
663663
behavior of the email package in Python 3.2.
664664

665+
.. note::
666+
667+
The :const:`compat32` policy should not be used as a policy for
668+
:class:`~email.message.EmailMessage` objects, and should only be used
669+
to serialize messages that were created using the :const:`compat32`
670+
policy.
671+
665672

666673
.. rubric:: Footnotes
667674

Doc/library/enum.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ Module Contents
153153

154154
Return a list of all power-of-two integers contained in a flag.
155155

156+
:func:`enum.bin`
157+
158+
Like built-in :func:`bin`, except negative values are represented in
159+
two's complement, and the leading bit always indicates sign
160+
(``0`` implies positive, ``1`` implies negative).
161+
156162

157163
.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
158164
.. versionadded:: 3.11 ``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``
@@ -1035,6 +1041,20 @@ Utilities and Decorators
10351041

10361042
.. versionadded:: 3.11
10371043

1044+
.. function:: bin(num, max_bits=None)
1045+
1046+
Like built-in :func:`bin`, except negative values are represented in
1047+
two's complement, and the leading bit always indicates sign
1048+
(``0`` implies positive, ``1`` implies negative).
1049+
1050+
>>> import enum
1051+
>>> enum.bin(10)
1052+
'0b0 1010'
1053+
>>> enum.bin(~10) # ~10 is -11
1054+
'0b1 0101'
1055+
1056+
.. versionadded:: 3.10
1057+
10381058
---------------
10391059

10401060
Notes

0 commit comments

Comments
 (0)