Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Doc/builtins/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,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
Expand Down Expand Up @@ -567,11 +566,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.

Expand Down
15 changes: 7 additions & 8 deletions Doc/builtins/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,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.
Expand Down Expand Up @@ -2166,10 +2166,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
Expand Down Expand Up @@ -2428,10 +2428,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
Expand Down
7 changes: 3 additions & 4 deletions Doc/builtins/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5667,7 +5667,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)``

Expand Down Expand Up @@ -5878,9 +5878,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()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/exception_hierarchy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BaseException
├── EOFError
├── ExceptionGroup [BaseExceptionGroup]
├── ImportError
│ └── ImportCycleError
│ ├── ImportCycleError
│ └── ModuleNotFoundError
├── LookupError
│ ├── IndexError
Expand Down
Loading