Skip to content

Commit bf035ba

Browse files
committed
Merge remote-tracking branch 'upstream/main' into doc-unicode-compact
2 parents 03589fc + dbd10a6 commit bf035ba

File tree

151 files changed

+4754
-2202
lines changed

Some content is hidden

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

151 files changed

+4754
-2202
lines changed

Doc/c-api/apiabiversion.rst

Lines changed: 21 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,10 @@ 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+
4970

5071
Run-time version
5172
----------------

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/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/ftplib.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,14 +524,9 @@ FTP_TLS objects
524524
:class:`!FTP_TLS` class inherits from :class:`FTP`,
525525
defining these additional methods and attributes:
526526

527-
.. attribute:: FTP_TLS.ssl_version
528-
529-
The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`).
530-
531527
.. method:: FTP_TLS.auth()
532528

533-
Set up a secure control connection by using TLS or SSL, depending on what
534-
is specified in the :attr:`ssl_version` attribute.
529+
Set up a secure control connection by using TLS.
535530

536531
.. versionchanged:: 3.4
537532
The method now supports hostname check with
@@ -548,7 +543,7 @@ FTP_TLS objects
548543

549544
.. method:: FTP_TLS.prot_p()
550545

551-
Set up secure data connection.
546+
Set up secure data connection by using TLS.
552547

553548
.. method:: FTP_TLS.prot_c()
554549

Doc/library/importlib.resources.abc.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@
6363
If the resource does not concretely exist on the file system,
6464
raise :exc:`FileNotFoundError`.
6565

66-
.. method:: is_resource(name)
66+
.. method:: is_resource(path)
6767
:abstractmethod:
6868

69-
Returns ``True`` if the named *name* is considered a resource.
70-
:exc:`FileNotFoundError` is raised if *name* does not exist.
69+
Returns ``True`` if the named *path* is considered a resource.
70+
:exc:`FileNotFoundError` is raised if *path* does not exist.
71+
72+
.. versionchanged:: 3.10
73+
The argument *name* was renamed to *path*.
7174

7275
.. method:: contents()
7376
:abstractmethod:

Doc/library/importlib.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ Functions
210210
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
211211
a :class:`~importlib.machinery.ModuleSpec`.
212212

213-
.. versionchanged:: 3.15
214-
If *module* is a lazy module that has not yet been materialized (i.e.,
215-
loaded via :class:`importlib.util.LazyLoader` and not yet accessed),
216-
calling :func:`reload` is a no-op and returns the module unchanged.
217-
This prevents the reload from unintentionally triggering the lazy load.
218-
219213
.. warning::
220214
This function is not thread-safe. Calling it from multiple threads can result
221215
in unexpected behavior. It's recommended to use the :class:`threading.Lock`

0 commit comments

Comments
 (0)