bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index b96297d..0efbe1c 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -369,11 +369,11 @@
.. _assert:
-The :keyword:`assert` statement
-===============================
+The :keyword:`!assert` statement
+================================
.. index::
- statement: assert
+ ! statement: assert
pair: debugging; assertions
single: , (comma); expression list
@@ -412,8 +412,8 @@
.. _pass:
-The :keyword:`pass` statement
-=============================
+The :keyword:`!pass` statement
+==============================
.. index::
statement: pass
@@ -434,11 +434,11 @@
.. _del:
-The :keyword:`del` statement
-============================
+The :keyword:`!del` statement
+=============================
.. index::
- statement: del
+ ! statement: del
pair: deletion; target
triple: deletion; target; list
@@ -473,11 +473,11 @@
.. _return:
-The :keyword:`return` statement
-===============================
+The :keyword:`!return` statement
+================================
.. index::
- statement: return
+ ! statement: return
pair: function; definition
pair: class; definition
@@ -495,7 +495,7 @@
.. index:: 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
+:keyword:`finally` clause, that :keyword:`!finally` clause is executed before
really leaving the function.
In a generator function, the :keyword:`return` statement indicates that the
@@ -505,13 +505,13 @@
In an asynchronous generator function, an empty :keyword:`return` statement
indicates that the asynchronous generator is done and will cause
-:exc:`StopAsyncIteration` to be raised. A non-empty :keyword:`return`
+:exc:`StopAsyncIteration` to be raised. A non-empty :keyword:`!return`
statement is a syntax error in an asynchronous generator function.
.. _yield:
-The :keyword:`yield` statement
-==============================
+The :keyword:`!yield` statement
+===============================
.. index::
statement: yield
@@ -546,11 +546,11 @@
.. _raise:
-The :keyword:`raise` statement
-==============================
+The :keyword:`!raise` statement
+===============================
.. index::
- statement: raise
+ ! statement: raise
single: exception
pair: raising; exception
single: __traceback__ (exception attribute)
@@ -649,11 +649,11 @@
.. _break:
-The :keyword:`break` statement
-==============================
+The :keyword:`!break` statement
+===============================
.. index::
- statement: break
+ ! statement: break
statement: for
statement: while
pair: loop; statement
@@ -668,7 +668,7 @@
.. index:: keyword: else
pair: loop control; target
-It terminates the nearest enclosing loop, skipping the optional :keyword:`else`
+It terminates the nearest enclosing loop, skipping the optional :keyword:`!else`
clause if the loop has one.
If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control
@@ -677,17 +677,17 @@
.. index:: 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
+:keyword:`finally` clause, that :keyword:`!finally` clause is executed before
really leaving the loop.
.. _continue:
-The :keyword:`continue` statement
-=================================
+The :keyword:`!continue` statement
+==================================
.. index::
- statement: continue
+ ! statement: continue
statement: for
statement: while
pair: loop; statement
@@ -701,18 +701,18 @@
that loop. It continues with the next cycle of the nearest enclosing loop.
When :keyword:`continue` passes control out of a :keyword:`try` statement with a
-:keyword:`finally` clause, that :keyword:`finally` clause is executed before
+:keyword:`finally` clause, that :keyword:`!finally` clause is executed before
really starting the next loop cycle.
.. _import:
.. _from:
-The :keyword:`import` statement
-===============================
+The :keyword:`!import` statement
+================================
.. index::
- statement: import
+ ! statement: import
single: module; importing
pair: name; binding
keyword: from
@@ -755,8 +755,8 @@
.. index:: single: as; import statement
-* If the module name is followed by :keyword:`as`, then the name
- following :keyword:`as` is bound directly to the imported module.
+* If the module name is followed by :keyword:`!as`, then the name
+ following :keyword:`!as` is bound directly to the imported module.
* If no other name is specified, and the module being imported is a top
level module, the module's name is bound in the local namespace as a
reference to the imported module
@@ -781,7 +781,7 @@
check the imported module again for that attribute
#. if the attribute is not found, :exc:`ImportError` is raised.
#. otherwise, a reference to that value is stored in the local namespace,
- using the name in the :keyword:`as` clause if it is present,
+ using the name in the :keyword:`!as` clause if it is present,
otherwise using the attribute name
Examples::
@@ -922,11 +922,11 @@
.. _global:
-The :keyword:`global` statement
-===============================
+The :keyword:`!global` statement
+================================
.. index::
- statement: global
+ ! statement: global
triple: global; name; binding
single: , (comma); identifier list
@@ -936,11 +936,11 @@
The :keyword:`global` statement is a declaration which holds for the entire
current code block. It means that the listed identifiers are to be interpreted
as globals. It would be impossible to assign to a global variable without
-:keyword:`global`, although free variables may refer to globals without being
+:keyword:`!global`, although free variables may refer to globals without being
declared global.
Names listed in a :keyword:`global` statement must not be used in the same code
-block textually preceding that :keyword:`global` statement.
+block textually preceding that :keyword:`!global` statement.
Names listed in a :keyword:`global` statement must not be defined as formal
parameters or in a :keyword:`for` loop control target, :keyword:`class`
@@ -959,18 +959,18 @@
builtin: compile
**Programmer's note:** :keyword:`global` is a directive to the parser. It
-applies only to code parsed at the same time as the :keyword:`global` statement.
-In particular, a :keyword:`global` statement contained in a string or code
+applies only to code parsed at the same time as the :keyword:`!global` statement.
+In particular, a :keyword:`!global` statement contained in a string or code
object supplied to the built-in :func:`exec` function does not affect the code
block *containing* the function call, and code contained in such a string is
-unaffected by :keyword:`global` statements in the code containing the function
+unaffected by :keyword:`!global` statements in the code containing the function
call. The same applies to the :func:`eval` and :func:`compile` functions.
.. _nonlocal:
-The :keyword:`nonlocal` statement
-=================================
+The :keyword:`!nonlocal` statement
+==================================
.. index:: statement: nonlocal
single: , (comma); identifier list