diff --git a/Doc/builtins/exceptions.rst b/Doc/builtins/exceptions.rst index ecf62fb6391b1b1..1bb52a02f48b2f4 100644 --- a/Doc/builtins/exceptions.rst +++ b/Doc/builtins/exceptions.rst @@ -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 @@ -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. diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst index dd84d96c1b751ba..efd6bb9e28c89ae 100644 --- a/Doc/builtins/functions.rst +++ b/Doc/builtins/functions.rst @@ -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 `. The length of the tuple must exactly match the length of the code object's :attr:`~codeobject.co_freevars` attribute. @@ -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 @@ -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 diff --git a/Doc/builtins/stdtypes.rst b/Doc/builtins/stdtypes.rst index 55a59f2879f2155..0cf234217cc5af7 100644 --- a/Doc/builtins/stdtypes.rst +++ b/Doc/builtins/stdtypes.rst @@ -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)`` @@ -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 `. - 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() diff --git a/Lib/test/exception_hierarchy.txt b/Lib/test/exception_hierarchy.txt index 98a5e950602eafc..6e9b1912ab67801 100644 --- a/Lib/test/exception_hierarchy.txt +++ b/Lib/test/exception_hierarchy.txt @@ -14,7 +14,7 @@ BaseException ├── EOFError ├── ExceptionGroup [BaseExceptionGroup] ├── ImportError - │ └── ImportCycleError + │ ├── ImportCycleError │ └── ModuleNotFoundError ├── LookupError │ ├── IndexError