https://github.com/python/cpython/commit/466b4319d86e6d61b7c3d48306917c04331e6dd7
commit: 466b4319d86e6d61b7c3d48306917c04331e6dd7
branch: 3.14
author: Inada Naoki <[email protected]>
committer: methane <[email protected]>
date: 2026-10-31T14:43:17+09:00
summary:
Docs: correct built-in exception, function, and dictionary descriptions
(GH-160979)
(cherry picked from commit 3fb88e94db547e9dbed97de68da87bcf9335a53a)
files:
M Doc/builtins/exceptions.rst
M Doc/builtins/functions.rst
M Doc/builtins/stdtypes.rst
diff --git a/Doc/builtins/exceptions.rst b/Doc/builtins/exceptions.rst
index aae9bad1a9f3e86..fe31c4a7e845caf 100644
--- a/Doc/builtins/exceptions.rst
+++ b/Doc/builtins/exceptions.rst
@@ -388,10 +388,9 @@ The following exceptions are the exceptions that are
usually raised.
.. attribute:: strerror
- The corresponding error message, as provided by
- the operating system. It is formatted by the C
- functions :c:func:`!perror` under POSIX, and :c:func:`!FormatMessage`
- under Windows.
+ The corresponding error message, as provided by the operating system.
+ Under POSIX, it is obtained using the C functions :c:func:`!strerror`
+ or :c:func:`!strerror_r`; under Windows, :c:func:`!FormatMessage` is
used.
.. attribute:: filename
filename2
@@ -552,11 +551,6 @@ The following exceptions are the exceptions that are
usually raised.
The column in the end line where the error occurred finishes. This is
1-indexed: the first character in the line has an ``offset`` of 1.
- For errors in f-string fields, the message is prefixed by "f-string: "
- and the offsets are offsets in a text constructed from the replacement
- expression. For example, compiling f'Bad {a b} field' results in this
- args attribute: ('f-string: ...', ('', 1, 2, '(a b)\n', 1, 5)).
-
.. versionchanged:: 3.10
Added the :attr:`end_lineno` and :attr:`end_offset` attributes.
diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst
index 8587af6f7862d34..7dc47eff1bc5feb 100644
--- a/Doc/builtins/functions.rst
+++ b/Doc/builtins/functions.rst
@@ -717,7 +717,7 @@ are always available. They are listed here in alphabetical
order.
still access all builtins.
The *closure* argument specifies a closure--a tuple of cellvars.
- It's only valid when the *object* is a code object containing
+ It's only valid when *source* is a code object containing
:term:`free (closure) variables <closure variable>`.
The length of the tuple must exactly match the length of the code object's
:attr:`~codeobject.co_freevars` attribute.
@@ -2025,10 +2025,10 @@ are always available. They are listed here in
alphabetical order.
When called directly within an ordinary method of a class, both arguments
may
be omitted ("zero-argument :func:`!super`"). In this case, *type* will be
the
- enclosing class, and *obj* will be the first argument of the immediately
- enclosing function (typically ``self``). (This means that zero-argument
+ enclosing class, and *object_or_type* will be the first argument of the
+ immediately enclosing function (typically ``self``). Zero-argument
:func:`!super` will not work as expected within nested functions, including
- generator expressions, which implicitly create nested functions.)
+ generator expressions, which implicitly create nested functions.
There are two typical use cases for *super*. In a class hierarchy with
single inheritance, *super* can be used to refer to parent classes without
@@ -2283,10 +2283,9 @@ are always available. They are listed here in
alphabetical order.
determine the package context of the :keyword:`import` statement.
*level* specifies whether to use absolute or relative imports. ``0`` (the
- default) means only perform absolute imports. Positive values for
- *level* indicate the number of parent directories to search relative to the
- directory of the module calling :func:`__import__` (see :pep:`328` for the
- details).
+ default) means only perform absolute imports. For relative imports,
+ ``1`` refers to the current package, ``2`` to its parent package, and so on
+ (see :pep:`328` for details).
When the *name* variable is of the form ``package.module``, normally, the
top-level package (the name up till the first dot) is returned, *not* the
diff --git a/Doc/builtins/stdtypes.rst b/Doc/builtins/stdtypes.rst
index d3780ba6c83e247..91f149f8d1c382d 100644
--- a/Doc/builtins/stdtypes.rst
+++ b/Doc/builtins/stdtypes.rst
@@ -5332,7 +5332,7 @@ can be used interchangeably to index the same dictionary
entry.
* Use a comma-separated list of ``key: value`` pairs within braces:
``{'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)``
@@ -5543,9 +5543,8 @@ can be used interchangeably to index the same dictionary
entry.
Return a new view of the dictionary's values. See the
:ref:`documentation of view objects <dict-views>`.
- 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]