]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-97950: Use new-style index directive ('keyword') (GH-104153) (#104155)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 4 May 2023 08:53:19 +0000 (01:53 -0700)
committerGitHub <noreply@github.com>
Thu, 4 May 2023 08:53:19 +0000 (10:53 +0200)
GH-97950: Use new-style index directive ('keyword') (GH-104153)

* Uncomment keyword removal in pairindextypes

* Use new-style index directive ('keyword') - Reference
(cherry picked from commit 33ca322c50baa5152afe388fb3b8b7d63dc5a9b9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/reference/compound_stmts.rst
Doc/reference/expressions.rst
Doc/reference/simple_stmts.rst
Doc/tools/extensions/pyspecific.py

index ade59dbe4394d2e88c12cadd24d133f01ae7518b..3ed7239cd3746061bd59be6bf8958616b31ffb21 100644 (file)
@@ -85,8 +85,8 @@ The :keyword:`!if` statement
 
 .. index::
    ! statement: if
-   keyword: elif
-   keyword: else
+   pair: keyword; elif
+   pair: keyword; else
    single: : (colon); compound statement
 
 The :keyword:`if` statement is used for conditional execution:
@@ -110,7 +110,7 @@ The :keyword:`!while` statement
 
 .. index::
    ! statement: while
-   keyword: else
+   pair: keyword; else
    pair: loop; statement
    single: : (colon); compound statement
 
@@ -143,8 +143,8 @@ The :keyword:`!for` statement
 
 .. index::
    ! statement: for
-   keyword: in
-   keyword: else
+   pair: keyword; in
+   pair: keyword; else
    pair: target; list
    pair: loop; statement
    object: sequence
@@ -206,10 +206,10 @@ The :keyword:`!try` statement
 
 .. index::
    ! statement: try
-   keyword: except
-   keyword: finally
-   keyword: else
-   keyword: as
+   pair: keyword; except
+   pair: keyword; finally
+   pair: keyword; else
+   pair: keyword; as
    single: : (colon); compound statement
 
 The :keyword:`!try` statement specifies exception handlers and/or cleanup code
@@ -326,7 +326,7 @@ stored in the :mod:`sys` module is reset to its previous value::
 
 
 .. index::
-   keyword: except_star
+   pair: keyword; except_star
 
 .. _except_star:
 
@@ -389,7 +389,7 @@ cannot appear in an :keyword:`!except*` clause.
 
 
 .. index::
-   keyword: else
+   pair: keyword; else
    statement: return
    statement: break
    statement: continue
@@ -406,7 +406,7 @@ the :keyword:`!else` clause are not handled by the preceding :keyword:`except`
 clauses.
 
 
-.. index:: keyword: finally
+.. index:: pair: keyword; finally
 
 .. _finally:
 
@@ -471,7 +471,7 @@ The :keyword:`!with` statement
 
 .. index::
    ! statement: with
-   keyword: as
+   pair: keyword; as
    single: as; with statement
    single: , (comma); with statement
    single: : (colon); compound statement
@@ -588,10 +588,10 @@ The :keyword:`!match` statement
 
 .. index::
    ! statement: match
-   ! keyword: case
+   ! pair: keyword; case
    ! single: pattern matching
-   keyword: if
-   keyword: as
+   pair: keyword; if
+   pair: keyword; as
    pair: match; case
    single: as; match statement
    single: : (colon); compound statement
@@ -1476,8 +1476,8 @@ Coroutine function definition
                 : ["->" `expression`] ":" `suite`
 
 .. index::
-   keyword: async
-   keyword: await
+   pair: keyword; async
+   pair: keyword; await
 
 Execution of Python coroutines can be suspended and resumed at many points
 (see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` and
index ea9db1824c705398a97c018d47b54d24120e7cff..0dcd7d89cc546de5671eaeaba9fd6468fe460bb6 100644 (file)
@@ -415,8 +415,8 @@ Yield expressions
 -----------------
 
 .. index::
-   keyword: yield
-   keyword: from
+   pair: keyword; yield
+   pair: keyword; from
    pair: yield; expression
    pair: generator; function
 
@@ -1138,7 +1138,7 @@ a class instance:
    if that method was called.
 
 
-.. index:: keyword: await
+.. index:: pair: keyword; await
 .. _await:
 
 Await expression
index c98ac81e415b72b07da6509ce8d23ac2b361d337..5c7b5d7efaa2b5bca1a728d1ac290e6519045602 100644 (file)
@@ -495,7 +495,7 @@ If an expression list is present, it is evaluated, else ``None`` is substituted.
 :keyword:`return` leaves the current function call with the expression list (or
 ``None``) as return value.
 
-.. index:: keyword: finally
+.. index:: pair: keyword; finally
 
 When :keyword:`return` passes control out of a :keyword:`try` statement with a
 :keyword:`finally` clause, that :keyword:`!finally` clause is executed before
@@ -679,7 +679,7 @@ The :keyword:`!break` statement
 :keyword:`while` loop, but not nested in a function or class definition within
 that loop.
 
-.. index:: keyword: else
+.. index:: pair: keyword; else
            pair: loop control; target
 
 It terminates the nearest enclosing loop, skipping the optional :keyword:`!else`
@@ -688,7 +688,7 @@ clause if the loop has one.
 If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control
 target keeps its current value.
 
-.. index:: keyword: finally
+.. index:: pair: keyword; finally
 
 When :keyword:`break` passes control out of a :keyword:`try` statement with a
 :keyword:`finally` clause, that :keyword:`!finally` clause is executed before
@@ -705,7 +705,7 @@ The :keyword:`!continue` statement
    statement: for
    statement: while
    pair: loop; statement
-   keyword: finally
+   pair: keyword; finally
 
 .. productionlist:: python-grammar
    continue_stmt: "continue"
@@ -729,8 +729,8 @@ The :keyword:`!import` statement
    ! statement: import
    single: module; importing
    pair: name; binding
-   keyword: from
-   keyword: as
+   pair: keyword; from
+   pair: keyword; as
    exception: ImportError
    single: , (comma); import statement
 
index 1888428437a6d5c19c2ac6bfbfe7974045f7a43b..52852dd4ce1b35dc364ddc15798ad4b6a383fe75 100644 (file)
@@ -695,7 +695,7 @@ def patch_pairindextypes(app) -> None:
         # exist, by deleting them when using the gettext builder.
 
         pairindextypes.pop('module', None)
-        pairindextypes.pop('keyword', None)
+        pairindextypes.pop('keyword', None)
         # pairindextypes.pop('operator', None)
         # pairindextypes.pop('object', None)
         # pairindextypes.pop('exception', None)