]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-97950: Use new-style index directive ('statement') (GH-104162) (#104163)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 4 May 2023 10:57:14 +0000 (03:57 -0700)
committerGitHub <noreply@github.com>
Thu, 4 May 2023 10:57:14 +0000 (13:57 +0300)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/library/exceptions.rst
Doc/library/functions.rst
Doc/library/site.rst
Doc/library/stdtypes.rst
Doc/reference/compound_stmts.rst
Doc/reference/datamodel.rst
Doc/reference/simple_stmts.rst
Doc/tools/extensions/pyspecific.py
Doc/tutorial/controlflow.rst

index aee1cb5cc6a4752277be390d3ba3dd1968658d90..4c84e5f855431a6a855f58e56b6d7f8d920393c9 100644 (file)
@@ -4,8 +4,8 @@ Built-in Exceptions
 ===================
 
 .. index::
-   statement: try
-   statement: except
+   pair: statement; try
+   pair: statement; except
 
 In Python, all exceptions must be instances of a class that derives from
 :class:`BaseException`.  In a :keyword:`try` statement with an :keyword:`except`
@@ -14,7 +14,7 @@ classes derived from that class (but not exception classes from which *it* is
 derived).  Two exception classes that are not related via subclassing are never
 equivalent, even if they have the same name.
 
-.. index:: statement: raise
+.. index:: pair: statement; raise
 
 The built-in exceptions listed below can be generated by the interpreter or
 built-in functions.  Except where mentioned, they have an "associated value"
@@ -175,7 +175,7 @@ The following exceptions are the exceptions that are usually raised.
 
 .. exception:: AssertionError
 
-   .. index:: statement: assert
+   .. index:: pair: statement; assert
 
    Raised when an :keyword:`assert` statement fails.
 
index c5bdfc21e1839bb172ff01649426cfbe8835d4ef..1a7311911ba7a2aff27843c91e3c73048d5b0321 100644 (file)
@@ -1978,7 +1978,7 @@ are always available.  They are listed here in alphabetical order.
 .. function:: __import__(name, globals=None, locals=None, fromlist=(), level=0)
 
    .. index::
-      statement: import
+      pair: statement; import
       pair: module; builtins
 
    .. note::
index 34b38f4d56f3cf12c11b3ca68e5c89d498ca7219..5b70dbced13e019d0ded90a7e40aa45c692616da 100644 (file)
@@ -51,7 +51,7 @@ searched for site-packages; otherwise they will.
 
 .. index::
    single: # (hash); comment
-   statement: import
+   pair: statement; import
 
 A path configuration file is a file whose name has the form :file:`{name}.pth`
 and exists in one of the four directories mentioned above; its contents are
index 960959073c4bf562eec93a31cc595248495ff1f0..d57581f1d535fd490a98bb0ea919d8939f6df2f7 100644 (file)
@@ -32,8 +32,8 @@ Truth Value Testing
 ===================
 
 .. index::
-   statement: if
-   statement: while
+   pair: statement; if
+   pair: statement; while
    pair: truth; value
    pair: Boolean; operations
    single: false
@@ -1113,7 +1113,7 @@ accepts integers that meet the value restriction ``0 <= x <= 255``).
    triple: operations on; list; type
    pair: subscript; assignment
    pair: slice; assignment
-   statement: del
+   pair: statement; del
    single: append() (sequence method)
    single: clear() (sequence method)
    single: copy() (sequence method)
@@ -4371,7 +4371,7 @@ Mapping Types --- :class:`dict`
    pair: object; dictionary
    triple: operations on; mapping; types
    triple: operations on; dictionary; type
-   statement: del
+   pair: statement; del
    builtin: len
 
 A :term:`mapping` object maps :term:`hashable` values to arbitrary objects.
index 4578e662ada69305066c70e57021365c7d4a7003..cd448d213487f254083137e9fea42741c0393f42 100644 (file)
@@ -84,7 +84,7 @@ The :keyword:`!if` statement
 ============================
 
 .. index::
-   ! statement: if
+   ! pair: statement; if
    pair: keyword; elif
    pair: keyword; else
    single: : (colon); compound statement
@@ -109,7 +109,7 @@ The :keyword:`!while` statement
 ===============================
 
 .. index::
-   ! statement: while
+   ! pair: statement; while
    pair: keyword; else
    pair: loop; statement
    single: : (colon); compound statement
@@ -127,8 +127,8 @@ suite of the :keyword:`!else` clause, if present, is executed and the loop
 terminates.
 
 .. index::
-   statement: break
-   statement: continue
+   pair: statement; break
+   pair: statement; continue
 
 A :keyword:`break` statement executed in the first suite terminates the loop
 without executing the :keyword:`!else` clause's suite.  A :keyword:`continue`
@@ -142,7 +142,7 @@ The :keyword:`!for` statement
 =============================
 
 .. index::
-   ! statement: for
+   ! pair: statement; for
    pair: keyword; in
    pair: keyword; else
    pair: target; list
@@ -167,8 +167,8 @@ the suite in the :keyword:`!else` clause,
 if present, is executed, and the loop terminates.
 
 .. index::
-   statement: break
-   statement: continue
+   pair: statement; break
+   pair: statement; continue
 
 A :keyword:`break` statement executed in the first suite terminates the loop
 without executing the :keyword:`!else` clause's suite.  A :keyword:`continue`
@@ -205,7 +205,7 @@ The :keyword:`!try` statement
 =============================
 
 .. index::
-   ! statement: try
+   ! pair: statement; try
    pair: keyword; except
    pair: keyword; finally
    pair: keyword; else
@@ -390,9 +390,9 @@ cannot appear in an :keyword:`!except*` clause.
 
 .. index::
    pair: keyword; else
-   statement: return
-   statement: break
-   statement: continue
+   pair: statement; return
+   pair: statement; break
+   pair: statement; continue
 
 .. _except_else:
 
@@ -436,9 +436,9 @@ The exception information is not available to the program during execution of
 the :keyword:`!finally` clause.
 
 .. index::
-   statement: return
-   statement: break
-   statement: continue
+   pair: statement; return
+   pair: statement; break
+   pair: statement; continue
 
 When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement is
 executed in the :keyword:`try` suite of a :keyword:`!try`...\ :keyword:`!finally`
@@ -470,7 +470,7 @@ The :keyword:`!with` statement
 ==============================
 
 .. index::
-   ! statement: with
+   ! pair: statement; with
    pair: keyword; as
    single: as; with statement
    single: , (comma); with statement
@@ -587,7 +587,7 @@ The :keyword:`!match` statement
 ===============================
 
 .. index::
-   ! statement: match
+   ! pair: statement; match
    ! pair: keyword; case
    ! single: pattern matching
    pair: keyword; if
@@ -1192,7 +1192,7 @@ Function definitions
 ====================
 
 .. index::
-   statement: def
+   pair: statement; def
    pair: function; definition
    pair: function; name
    pair: name; binding
@@ -1366,7 +1366,7 @@ Class definitions
 
 .. index::
    pair: object; class
-   statement: class
+   pair: statement; class
    pair: class; definition
    pair: class; name
    pair: name; binding
@@ -1465,7 +1465,7 @@ Coroutines
 
 .. versionadded:: 3.5
 
-.. index:: statement: async def
+.. index:: pair: statement; async def
 .. _`async def`:
 
 Coroutine function definition
@@ -1499,7 +1499,7 @@ An example of a coroutine function::
    ``await`` and ``async`` are now keywords; previously they were only
    treated as such inside the body of a coroutine function.
 
-.. index:: statement: async for
+.. index:: pair: statement; async for
 .. _`async for`:
 
 The :keyword:`!async for` statement
@@ -1544,7 +1544,7 @@ It is a :exc:`SyntaxError` to use an ``async for`` statement outside the
 body of a coroutine function.
 
 
-.. index:: statement: async with
+.. index:: pair: statement; async with
 .. _`async with`:
 
 The :keyword:`!async with` statement
index 3f3a37dacc15f7f1e7b2c657399b0f6906f3ea93..73eb402b71660ef277077d9096ece60972006e2e 100644 (file)
@@ -727,7 +727,7 @@ Callable types
 
 Modules
    .. index::
-      statement: import
+      pair: statement; import
       pair: object; module
 
    Modules are a basic organizational unit of Python code, and are created by
@@ -1150,7 +1150,7 @@ Internal types
          single: tb_frame (traceback attribute)
          single: tb_lineno (traceback attribute)
          single: tb_lasti (traceback attribute)
-         statement: try
+         pair: statement; try
 
       Special read-only attributes:
       :attr:`tb_frame` points to the execution frame of the current level;
@@ -1309,7 +1309,7 @@ Basic customization
    .. index::
       single: destructor
       single: finalizer
-      statement: del
+      pair: statement; del
 
    Called when the instance is about to be destroyed.  This is also called a
    finalizer or (improperly) a destructor.  If a base class has a
@@ -2791,7 +2791,7 @@ execution of the block of code.  Context managers are normally invoked using the
 used by directly invoking their methods.
 
 .. index::
-   statement: with
+   pair: statement; with
    single: context manager
 
 Typical uses of context managers include saving and restoring various kinds of
index 7cf096019631da97e0d8370271fc7b374411d711..ca1aa744389bda8330276bcbea7635f9fcda3b48 100644 (file)
@@ -376,7 +376,7 @@ The :keyword:`!assert` statement
 ================================
 
 .. index::
-   ! statement: assert
+   ! pair: statement; assert
    pair: debugging; assertions
    single: , (comma); expression list
 
@@ -419,7 +419,7 @@ The :keyword:`!pass` statement
 ==============================
 
 .. index::
-   statement: pass
+   pair: statement; pass
    pair: null; operation
            pair: null; operation
 
@@ -441,7 +441,7 @@ The :keyword:`!del` statement
 =============================
 
 .. index::
-   ! statement: del
+   ! pair: statement; del
    pair: deletion; target
    triple: deletion; target; list
 
@@ -454,7 +454,7 @@ Rather than spelling it out in full details, here are some hints.
 Deletion of a target list recursively deletes each target, from left to right.
 
 .. index::
-   statement: global
+   pair: statement; global
    pair: unbinding; name
 
 Deletion of a name removes the binding of that name from the local or global
@@ -480,7 +480,7 @@ The :keyword:`!return` statement
 ================================
 
 .. index::
-   ! statement: return
+   ! pair: statement; return
    pair: function; definition
    pair: class; definition
 
@@ -517,7 +517,7 @@ The :keyword:`!yield` statement
 ===============================
 
 .. index::
-   statement: yield
+   pair: statement; yield
    single: generator; function
    single: generator; iterator
    single: function; generator
@@ -553,7 +553,7 @@ The :keyword:`!raise` statement
 ===============================
 
 .. index::
-   ! statement: raise
+   ! pair: statement; raise
    single: exception
    pair: raising; exception
    single: __traceback__ (exception attribute)
@@ -667,9 +667,9 @@ The :keyword:`!break` statement
 ===============================
 
 .. index::
-   ! statement: break
-   statement: for
-   statement: while
+   ! pair: statement; break
+   pair: statement; for
+   pair: statement; while
    pair: loop; statement
 
 .. productionlist:: python-grammar
@@ -701,9 +701,9 @@ The :keyword:`!continue` statement
 ==================================
 
 .. index::
-   ! statement: continue
-   statement: for
-   statement: while
+   ! pair: statement; continue
+   pair: statement; for
+   pair: statement; while
    pair: loop; statement
    pair: keyword; finally
 
@@ -726,7 +726,7 @@ The :keyword:`!import` statement
 ================================
 
 .. index::
-   ! statement: import
+   ! pair: statement; import
    single: module; importing
    pair: name; binding
    pair: keyword; from
@@ -942,7 +942,7 @@ The :keyword:`!global` statement
 ================================
 
 .. index::
-   ! statement: global
+   ! pair: statement; global
    triple: global; name; binding
    single: , (comma); identifier list
 
@@ -988,7 +988,7 @@ call.  The same applies to the :func:`eval` and :func:`compile` functions.
 The :keyword:`!nonlocal` statement
 ==================================
 
-.. index:: statement: nonlocal
+.. index:: pair: statement; nonlocal
    single: , (comma); identifier list
 
 .. productionlist:: python-grammar
index 469b43254090ef0d1b664a59f2b22f4d38a20f5e..f9b2bfdc639a7c001955dbbb1a76047ab9dce474 100644 (file)
@@ -699,7 +699,7 @@ def patch_pairindextypes(app) -> None:
         pairindextypes.pop('operator', None)
         pairindextypes.pop('object', None)
         pairindextypes.pop('exception', None)
-        pairindextypes.pop('statement', None)
+        pairindextypes.pop('statement', None)
         # pairindextypes.pop('builtin', None)
 
 
index 52db51e84cd5fca4c008613f92dca77c72fd53cd..c9b3d982c31c9af8ec01a2eb36f1b394e4b9df4a 100644 (file)
@@ -46,7 +46,7 @@ details see :ref:`tut-match`.
 ==========================
 
 .. index::
-   statement: for
+   pair: statement; for
 
 The :keyword:`for` statement in Python differs a bit from what you may be used
 to in C or Pascal.  Rather than always iterating over an arithmetic progression