https://github.com/python/cpython/commit/9087f84adf8fb74c190fccc99c4697c9dde50750
commit: 9087f84adf8fb74c190fccc99c4697c9dde50750
branch: 3.14
author: Inada Naoki <[email protected]>
committer: methane <[email protected]>
date: 2026-11-09T04:39:28Z
summary:

Doc: Correct built-in function and type descriptions (GH-161552)

(cherry picked from commit 3dee86d70560329437c2e774a1a89a3c57b14119)

files:
M Doc/builtins/functions.rst
M Doc/builtins/stdtypes.rst
M Doc/reference/expressions.rst
M Lib/pydoc_data/topics.py

diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst
index 7dc47eff1bc5feb..07654cc7a2cdc9e 100644
--- a/Doc/builtins/functions.rst
+++ b/Doc/builtins/functions.rst
@@ -685,7 +685,7 @@ are always available.  They are listed here in alphabetical 
order.
    This function supports dynamic execution of Python code. *source* must be
    either a string or a code object.  If it is a string, the string is parsed 
as
    a suite of Python statements which is then executed (unless a syntax error
-   occurs). [#]_ If it is a code object, it is simply executed.  In all cases,
+   occurs). If it is a code object, it is simply executed.  In all cases,
    the code that's executed is expected to be valid as file input (see the
    section :ref:`file-input` in the Reference Manual). Be aware that the
    :keyword:`nonlocal`, :keyword:`yield`,  and :keyword:`return`
@@ -2325,9 +2325,3 @@ are always available.  They are listed here in 
alphabetical order.
    .. versionchanged:: 3.9
       When the command line options :option:`-E` or :option:`-I` are being 
used,
       the environment variable :envvar:`PYTHONCASEOK` is now ignored.
-
-.. rubric:: Footnotes
-
-.. [#] Note that the parser only accepts the Unix-style end of line convention.
-   If you are reading the code from a file, make sure to use newline conversion
-   mode to convert Windows or Mac-style newlines.
diff --git a/Doc/builtins/stdtypes.rst b/Doc/builtins/stdtypes.rst
index 71d806d3545c39d..d956ec7c5627b0d 100644
--- a/Doc/builtins/stdtypes.rst
+++ b/Doc/builtins/stdtypes.rst
@@ -2042,19 +2042,19 @@ expression support in the :mod:`re` module).
 
    Perform a string formatting operation.  The string on which this method is
    called can contain literal text or replacement fields delimited by braces
-   ``{}``.  Each replacement field contains either the numeric index of a
-   positional argument, or the name of a keyword argument.  Returns a copy of
+   ``{}``.  Each replacement field refers to a positional argument (numbered
+   explicitly or automatically) or a keyword argument.  Returns a copy of
    the string where each replacement field is replaced with the string value of
    the corresponding argument. For example:
 
    .. doctest::
 
-      >>> "The sum of 1 + 2 is {0}".format(1+2)
-      'The sum of 1 + 2 is 3'
-      >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
+      >>> "The sum of {} + {} is {}".format(1, 2, 1+2)
       'The sum of 1 + 2 is 3'
       >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
       'Nobody expects the Spanish Inquisition!'
+      >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
+      'The sum of 1 + 2 is 3'
 
    See :ref:`formatstrings` for a description of the various formatting options
    that can be specified in format strings.
@@ -2897,7 +2897,7 @@ expression support in the :mod:`re` module).
 
    Return a copy of the string with all the cased characters [4]_ converted to
    uppercase.  Note that ``s.upper().isupper()`` might be ``False`` if ``s``
-   contains uncased characters or if the Unicode category of the resulting
+   contains no cased characters or if the Unicode category of the resulting
    character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
    titlecase).
 
@@ -3254,9 +3254,8 @@ The conversion types are:
 |            | character in the result.                            |       |
 +------------+-----------------------------------------------------+-------+
 
-For floating-point formats, the result should be correctly rounded to a given
-precision ``p`` of digits after the decimal point.  The rounding mode matches
-that of the :func:`round` builtin.
+For floating-point formats, the result should be correctly rounded to the
+specified precision.  The rounding mode matches that of the :func:`round` 
builtin.
 
 Notes:
 
@@ -6152,8 +6151,8 @@ The user-exposed type for the union object can be 
accessed from
 
 .. note::
    The :meth:`!__or__` method for type objects was added to support the syntax
-   ``X | Y``.  If a metaclass implements :meth:`!__or__`, the Union may
-   override it:
+   ``X | Y``.  If a metaclass implements :meth:`!__or__`, it may override
+   the default behavior of creating a union:
 
    .. doctest::
 
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 3308a24b91a5323..d66682d33c616d2 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1034,8 +1034,8 @@ which are used to control the execution of a generator 
function.
    If the asynchronous generator function then exits gracefully, is already
    closed, or raises :exc:`GeneratorExit` (by not catching the exception),
    then the returned awaitable will raise a :exc:`StopIteration` exception.
-   Any further awaitables returned by subsequent calls to the asynchronous
-   generator will raise a :exc:`StopAsyncIteration` exception.  If the
+   Awaitables returned by subsequent calls to :meth:`~agen.__anext__`
+   or :meth:`~agen.asend` will raise a :exc:`StopAsyncIteration` exception.  
If the
    asynchronous generator yields a value, a :exc:`RuntimeError` is raised
    by the awaitable.  If the asynchronous generator raises any other exception,
    it is propagated to the caller of the awaitable.  If the asynchronous
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index a5747b94f298139..296e393f1b283c7 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,4 +1,4 @@
-# Autogenerated by Sphinx on Sun Oct 25 19:11:52 2026
+# Autogenerated by Sphinx on Mon Nov  9 04:03:09 2026
 # as part of the release process.
 
 topics = {
@@ -3277,9 +3277,9 @@ def add(self, arg: T) -> None:
 
    def overly_generic[
       SimpleTypeVar,
-      TypeVarWithDefault = int,
       TypeVarWithBound: int,
       TypeVarWithConstraints: (str, bytes),
+      TypeVarWithDefault = int,
       *SimpleTypeVarTuple = (int, float),
       **SimpleParamSpec = (str, bytearray),
    ](
@@ -3377,7 +3377,7 @@ class Bag(typing.Generic[T]):
 outside that scope. This is illustrated by this example:
 
    @decorator
-   class Bag(Base[T], arg=T): ...
+   class Bag[T](Base[T], arg=T): ...
 
 This is equivalent to:
 
@@ -4087,8 +4087,8 @@ def double(x):
 
 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".
+   Asynchronous version of "set_trace()". This function should be used
+   inside a *coroutine function* with "await". For instance:
 
       async def f():
           await pdb.set_trace_async()
@@ -4664,7 +4664,7 @@ class pdb.Pdb(completekey='tab', stdin=None, stdout=None, 
skip=None, nosigint=Fa
 
    List or jump between chained exceptions.
 
-   When using "pdb.pm()"  or "Pdb.post_mortem(...)" with a chained
+   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 "exceptions <number>" to switch to that exception.
@@ -10507,7 +10507,14 @@ class is used in a class pattern with positional 
arguments, each
 str.capitalize()
 
    Return a copy of the string with its first character capitalized
-   and the rest lowercased.
+   and the rest lowercased. For example:
+
+      >>> 'PYTHON IS AMAZING'.capitalize()
+      'Python is amazing'
+      >>> 'Njemačka starts With a non-ASCII digraph'.capitalize()
+      'Njemačka starts with a non-ascii digraph'
+
+   See also "title()".
 
    Changed in version 3.8: The first character is now put into
    titlecase rather than uppercase. This means that characters like
@@ -10668,18 +10675,18 @@ class is used in a class pattern with positional 
arguments, each
 
    Perform a string formatting operation.  The string on which this
    method is called can contain literal text or replacement fields
-   delimited by braces "{}".  Each replacement field contains either
-   the numeric index of a positional argument, or the name of a
+   delimited by braces "{}".  Each replacement field refers to a
+   positional argument (numbered explicitly or automatically) or a
    keyword argument.  Returns a copy of the string where each
    replacement field is replaced with the string value of the
    corresponding argument. For example:
 
-      >>> "The sum of 1 + 2 is {0}".format(1+2)
-      'The sum of 1 + 2 is 3'
-      >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
+      >>> "The sum of {} + {} is {}".format(1, 2, 1+2)
       'The sum of 1 + 2 is 3'
       >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
       'Nobody expects the Spanish Inquisition!'
+      >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
+      'The sum of 1 + 2 is 3'
 
    See Format string syntax for a description of the various
    formatting options that can be specified in format strings.
@@ -11406,7 +11413,7 @@ class is used in a class pattern with positional 
arguments, each
       >>> titlecase("they're bill's friends.")
       "They're Bill's Friends."
 
-   See also "istitle()".
+   See also "istitle()" and "capitalize()".
 
 str.translate(table, /)
 
@@ -11429,7 +11436,7 @@ class is used in a class pattern with positional 
arguments, each
 
    Return a copy of the string with all the cased characters [4]
    converted to uppercase.  Note that "s.upper().isupper()" might be
-   "False" if "s" contains uncased characters or if the Unicode
+   "False" if "s" contains no cased characters or if the Unicode
    category of the resulting character(s) is not “Lu” (Letter,
    uppercase), but e.g. “Lt” (Letter, titlecase).
 
@@ -13878,7 +13885,7 @@ class dict(iterable, /, **kwargs)
      "{'jack': 4098, 'sjoerd': 4127}" or "{4098: 'jack', 4127:
      'sjoerd'}"
 
-   * Use a dict comprehension: "{}", "{x: x ** 2 for x in range(10)}"
+   * Use a dict comprehension: "{x: x ** 2 for x in range(10)}"
 
    * Use the type constructor: "dict()", "dict([('foo', 100), ('bar',
      200)])", "dict(foo=100, bar=200)"
@@ -14094,9 +14101,9 @@ class dict(iterable, /, **kwargs)
       Return a new view of the dictionary’s values.  See the
       documentation of view objects.
 
-      An equality comparison between one "dict.values()" view and
-      another will always return "False". This also applies when
-      comparing "dict.values()" to itself:
+      An equality comparison between two distinct "dict.values()"
+      views will always return "False", even for views of the same
+      dictionary:
 
          >>> d = {'a': 1}
          >>> d.values() == d.values()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to