mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
[3.11] GH-97950: Use new-style index directive ('exception') (GH-104160) (#104161)
This commit is contained in:
parent
c463796ba7
commit
99e6314d93
3 changed files with 13 additions and 13 deletions
|
@ -71,7 +71,7 @@ An identifier occurring as an atom is a name. See section :ref:`identifiers`
|
|||
for lexical definition and section :ref:`naming` for documentation of naming and
|
||||
binding.
|
||||
|
||||
.. index:: exception: NameError
|
||||
.. index:: pair: exception; NameError
|
||||
|
||||
When the name is bound to an object, evaluation of the atom yields that object.
|
||||
When a name is not bound, an attempt to evaluate it raises a :exc:`NameError`
|
||||
|
@ -534,7 +534,7 @@ be used to control the execution of a generator function.
|
|||
Note that calling any of the generator methods below when the generator
|
||||
is already executing raises a :exc:`ValueError` exception.
|
||||
|
||||
.. index:: exception: StopIteration
|
||||
.. index:: pair: exception; StopIteration
|
||||
|
||||
|
||||
.. method:: generator.__next__()
|
||||
|
@ -584,7 +584,7 @@ is already executing raises a :exc:`ValueError` exception.
|
|||
:attr:`~BaseException.__traceback__` attribute stored in *value* may
|
||||
be cleared.
|
||||
|
||||
.. index:: exception: GeneratorExit
|
||||
.. index:: pair: exception; GeneratorExit
|
||||
|
||||
|
||||
.. method:: generator.close()
|
||||
|
@ -706,7 +706,7 @@ This subsection describes the methods of an asynchronous generator iterator,
|
|||
which are used to control the execution of a generator function.
|
||||
|
||||
|
||||
.. index:: exception: StopAsyncIteration
|
||||
.. index:: pair: exception; StopAsyncIteration
|
||||
|
||||
.. coroutinemethod:: agen.__anext__()
|
||||
|
||||
|
@ -752,7 +752,7 @@ which are used to control the execution of a generator function.
|
|||
raises a different exception, then when the awaitable is run that exception
|
||||
propagates to the caller of the awaitable.
|
||||
|
||||
.. index:: exception: GeneratorExit
|
||||
.. index:: pair: exception; GeneratorExit
|
||||
|
||||
|
||||
.. coroutinemethod:: agen.aclose()
|
||||
|
@ -799,7 +799,7 @@ An attribute reference is a primary followed by a period and a name:
|
|||
attributeref: `primary` "." `identifier`
|
||||
|
||||
.. index::
|
||||
exception: AttributeError
|
||||
pair: exception; AttributeError
|
||||
pair: object; module
|
||||
pair: object; list
|
||||
|
||||
|
@ -1230,7 +1230,7 @@ applies to integral numbers or to custom objects that override the
|
|||
|
||||
|
||||
|
||||
.. index:: exception: TypeError
|
||||
.. index:: pair: exception; TypeError
|
||||
|
||||
In all three cases, if the argument does not have the proper type, a
|
||||
:exc:`TypeError` exception is raised.
|
||||
|
@ -1277,7 +1277,7 @@ builtin Python types implement this operator.
|
|||
.. versionadded:: 3.5
|
||||
|
||||
.. index::
|
||||
exception: ZeroDivisionError
|
||||
pair: exception; ZeroDivisionError
|
||||
single: division
|
||||
pair: operator; / (slash)
|
||||
pair: operator; //
|
||||
|
@ -1366,7 +1366,7 @@ the left or right by the number of bits given by the second argument.
|
|||
This operation can be customized using the special :meth:`__lshift__` and
|
||||
:meth:`__rshift__` methods.
|
||||
|
||||
.. index:: exception: ValueError
|
||||
.. index:: pair: exception; ValueError
|
||||
|
||||
A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A left
|
||||
shift by *n* bits is defined as multiplication with ``pow(2,n)``.
|
||||
|
|
|
@ -398,7 +398,7 @@ The extended form, ``assert expression1, expression2``, is equivalent to ::
|
|||
|
||||
.. index::
|
||||
single: __debug__
|
||||
exception: AssertionError
|
||||
pair: exception; AssertionError
|
||||
|
||||
These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to
|
||||
the built-in variables with those names. In the current implementation, the
|
||||
|
@ -521,7 +521,7 @@ The :keyword:`!yield` statement
|
|||
single: generator; function
|
||||
single: generator; iterator
|
||||
single: function; generator
|
||||
exception: StopIteration
|
||||
pair: exception; StopIteration
|
||||
|
||||
.. productionlist:: python-grammar
|
||||
yield_stmt: `yield_expression`
|
||||
|
@ -731,7 +731,7 @@ The :keyword:`!import` statement
|
|||
pair: name; binding
|
||||
pair: keyword; from
|
||||
pair: keyword; as
|
||||
exception: ImportError
|
||||
pair: exception; ImportError
|
||||
single: , (comma); import statement
|
||||
|
||||
.. productionlist:: python-grammar
|
||||
|
|
|
@ -698,7 +698,7 @@ def patch_pairindextypes(app) -> None:
|
|||
pairindextypes.pop('keyword', None)
|
||||
pairindextypes.pop('operator', None)
|
||||
pairindextypes.pop('object', None)
|
||||
# pairindextypes.pop('exception', None)
|
||||
pairindextypes.pop('exception', None)
|
||||
# pairindextypes.pop('statement', None)
|
||||
# pairindextypes.pop('builtin', None)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue