Skip to content

Commit 33ca322

Browse files
authored
GH-97950: Use new-style index directive ('keyword') (#104153)
* Uncomment keyword removal in pairindextypes * Use new-style index directive ('keyword') - Reference
1 parent d012237 commit 33ca322

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

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

388388

389389
.. index::
390-
keyword: else
390+
pair: keyword; else
391391
statement: return
392392
statement: break
393393
statement: continue
@@ -404,7 +404,7 @@ the :keyword:`!else` clause are not handled by the preceding :keyword:`except`
404404
clauses.
405405

406406

407-
.. index:: keyword: finally
407+
.. index:: pair: keyword; finally
408408

409409
.. _finally:
410410

@@ -469,7 +469,7 @@ The :keyword:`!with` statement
469469

470470
.. index::
471471
! statement: with
472-
keyword: as
472+
pair: keyword; as
473473
single: as; with statement
474474
single: , (comma); with statement
475475
single: : (colon); compound statement
@@ -586,10 +586,10 @@ The :keyword:`!match` statement
586586

587587
.. index::
588588
! statement: match
589-
! keyword: case
589+
! pair: keyword; case
590590
! single: pattern matching
591-
keyword: if
592-
keyword: as
591+
pair: keyword; if
592+
pair: keyword; as
593593
pair: match; case
594594
single: as; match statement
595595
single: : (colon); compound statement
@@ -1474,8 +1474,8 @@ Coroutine function definition
14741474
: ["->" `expression`] ":" `suite`
14751475

14761476
.. index::
1477-
keyword: async
1478-
keyword: await
1477+
pair: keyword; async
1478+
pair: keyword; await
14791479

14801480
Execution of Python coroutines can be suspended and resumed at many points
14811481
(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

@@ -1149,7 +1149,7 @@ a class instance:
11491149
if that method was called.
11501150

11511151

1152-
.. index:: keyword: await
1152+
.. index:: pair: keyword; await
11531153
.. _await:
11541154

11551155
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
@@ -690,7 +690,7 @@ def patch_pairindextypes(app) -> None:
690690
# exist, by deleting them when using the gettext builder.
691691

692692
pairindextypes.pop('module', None)
693-
# pairindextypes.pop('keyword', None)
693+
pairindextypes.pop('keyword', None)
694694
# pairindextypes.pop('operator', None)
695695
# pairindextypes.pop('object', None)
696696
# pairindextypes.pop('exception', None)

0 commit comments

Comments
 (0)