Skip to content

Commit a9fcf01

Browse files
[3.11] GH-97950: Use new-style index directive ('keyword') (GH-104153) (#104155)
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 33ca322) Co-authored-by: Adam Turner <[email protected]>
1 parent 0056369 commit a9fcf01

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ The :keyword:`!if` statement
8585

8686
.. index::
8787
! statement: if
88-
keyword: elif
89-
keyword: else
88+
pair: keyword; elif
89+
pair: keyword; else
9090
single: : (colon); compound statement
9191

9292
The :keyword:`if` statement is used for conditional execution:
@@ -110,7 +110,7 @@ The :keyword:`!while` statement
110110

111111
.. index::
112112
! statement: while
113-
keyword: else
113+
pair: keyword; else
114114
pair: loop; statement
115115
single: : (colon); compound statement
116116

@@ -143,8 +143,8 @@ The :keyword:`!for` statement
143143

144144
.. index::
145145
! statement: for
146-
keyword: in
147-
keyword: else
146+
pair: keyword; in
147+
pair: keyword; else
148148
pair: target; list
149149
pair: loop; statement
150150
object: sequence
@@ -206,10 +206,10 @@ The :keyword:`!try` statement
206206

207207
.. index::
208208
! statement: try
209-
keyword: except
210-
keyword: finally
211-
keyword: else
212-
keyword: as
209+
pair: keyword; except
210+
pair: keyword; finally
211+
pair: keyword; else
212+
pair: keyword; as
213213
single: : (colon); compound statement
214214

215215
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::
326326

327327

328328
.. index::
329-
keyword: except_star
329+
pair: keyword; except_star
330330

331331
.. _except_star:
332332

@@ -389,7 +389,7 @@ cannot appear in an :keyword:`!except*` clause.
389389

390390

391391
.. index::
392-
keyword: else
392+
pair: keyword; else
393393
statement: return
394394
statement: break
395395
statement: continue
@@ -406,7 +406,7 @@ the :keyword:`!else` clause are not handled by the preceding :keyword:`except`
406406
clauses.
407407

408408

409-
.. index:: keyword: finally
409+
.. index:: pair: keyword; finally
410410

411411
.. _finally:
412412

@@ -471,7 +471,7 @@ The :keyword:`!with` statement
471471

472472
.. index::
473473
! statement: with
474-
keyword: as
474+
pair: keyword; as
475475
single: as; with statement
476476
single: , (comma); with statement
477477
single: : (colon); compound statement
@@ -588,10 +588,10 @@ The :keyword:`!match` statement
588588

589589
.. index::
590590
! statement: match
591-
! keyword: case
591+
! pair: keyword; case
592592
! single: pattern matching
593-
keyword: if
594-
keyword: as
593+
pair: keyword; if
594+
pair: keyword; as
595595
pair: match; case
596596
single: as; match statement
597597
single: : (colon); compound statement
@@ -1476,8 +1476,8 @@ Coroutine function definition
14761476
: ["->" `expression`] ":" `suite`
14771477

14781478
.. index::
1479-
keyword: async
1480-
keyword: await
1479+
pair: keyword; async
1480+
pair: keyword; await
14811481

14821482
Execution of Python coroutines can be suspended and resumed at many points
14831483
(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` and

Doc/reference/expressions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ Yield expressions
415415
-----------------
416416

417417
.. index::
418-
keyword: yield
419-
keyword: from
418+
pair: keyword; yield
419+
pair: keyword; from
420420
pair: yield; expression
421421
pair: generator; function
422422

@@ -1138,7 +1138,7 @@ a class instance:
11381138
if that method was called.
11391139

11401140

1141-
.. index:: keyword: await
1141+
.. index:: pair: keyword; await
11421142
.. _await:
11431143

11441144
Await expression

Doc/reference/simple_stmts.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ If an expression list is present, it is evaluated, else ``None`` is substituted.
495495
:keyword:`return` leaves the current function call with the expression list (or
496496
``None``) as return value.
497497

498-
.. index:: keyword: finally
498+
.. index:: pair: keyword; finally
499499

500500
When :keyword:`return` passes control out of a :keyword:`try` statement with a
501501
:keyword:`finally` clause, that :keyword:`!finally` clause is executed before
@@ -679,7 +679,7 @@ The :keyword:`!break` statement
679679
:keyword:`while` loop, but not nested in a function or class definition within
680680
that loop.
681681

682-
.. index:: keyword: else
682+
.. index:: pair: keyword; else
683683
pair: loop control; target
684684

685685
It terminates the nearest enclosing loop, skipping the optional :keyword:`!else`
@@ -688,7 +688,7 @@ clause if the loop has one.
688688
If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control
689689
target keeps its current value.
690690

691-
.. index:: keyword: finally
691+
.. index:: pair: keyword; finally
692692

693693
When :keyword:`break` passes control out of a :keyword:`try` statement with a
694694
:keyword:`finally` clause, that :keyword:`!finally` clause is executed before
@@ -705,7 +705,7 @@ The :keyword:`!continue` statement
705705
statement: for
706706
statement: while
707707
pair: loop; statement
708-
keyword: finally
708+
pair: keyword; finally
709709

710710
.. productionlist:: python-grammar
711711
continue_stmt: "continue"
@@ -729,8 +729,8 @@ The :keyword:`!import` statement
729729
! statement: import
730730
single: module; importing
731731
pair: name; binding
732-
keyword: from
733-
keyword: as
732+
pair: keyword; from
733+
pair: keyword; as
734734
exception: ImportError
735735
single: , (comma); import statement
736736

Doc/tools/extensions/pyspecific.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def patch_pairindextypes(app) -> None:
695695
# exist, by deleting them when using the gettext builder.
696696

697697
pairindextypes.pop('module', None)
698-
# pairindextypes.pop('keyword', None)
698+
pairindextypes.pop('keyword', None)
699699
# pairindextypes.pop('operator', None)
700700
# pairindextypes.pop('object', None)
701701
# pairindextypes.pop('exception', None)

0 commit comments

Comments
 (0)