Some cleanup in the docs.
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 9c6135c..e37618a 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -70,6 +70,8 @@
.. _if:
+.. _elif:
+.. _else:
The :keyword:`if` statement
===========================
@@ -206,6 +208,8 @@
.. _try:
+.. _except:
+.. _finally:
The :keyword:`try` statement
============================
@@ -320,6 +324,7 @@
.. _with:
+.. _as:
The :keyword:`with` statement
=============================
@@ -386,6 +391,7 @@
.. _function:
+.. _def:
Function definitions
====================
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index dc2fbd8..b45044d 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -214,8 +214,6 @@
without causing overflow, will yield the same result in the long integer domain
or when using mixed operands.
- .. % Integers
-
Floating point numbers
.. index::
object: floating point
@@ -241,8 +239,6 @@
The real and imaginary parts of a complex number ``z`` can be retrieved through
the read-only attributes ``z.real`` and ``z.imag``.
- .. % Numbers
-
Sequences
.. index::
builtin: len
@@ -346,8 +342,6 @@
by itself does not create a tuple, since parentheses must be usable for grouping
of expressions). An empty tuple can be formed by an empty pair of parentheses.
- .. % Immutable sequences
-
Mutable sequences
.. index::
object: mutable sequence
@@ -376,10 +370,6 @@
The extension module :mod:`array` provides an additional example of a mutable
sequence type.
- .. % Mutable sequences
-
- .. % Sequences
-
Set types
.. index::
builtin: len
@@ -414,8 +404,6 @@
:term:`hashable`, it can be used again as an element of another set, or as
a dictionary key.
- .. % Set types
-
Mappings
.. index::
builtin: len
@@ -453,8 +441,6 @@
The extension modules :mod:`dbm`, :mod:`gdbm`, and :mod:`bsddb` provide
additional examples of mapping types.
- .. % Mapping types
-
Callable types
.. index::
object: callable
@@ -726,8 +712,6 @@
object used to initialize the module (since it isn't needed once the
initialization is done).
- .. %
-
Attribute assignment updates the module's namespace dictionary, e.g., ``m.x =
1`` is equivalent to ``m.__dict__["x"] = 1``.
@@ -1078,10 +1062,6 @@
described above, under "User-defined methods". Class method objects are created
by the built-in :func:`classmethod` constructor.
- .. % Internal types
-
-.. % Types
-.. % =========================================================================
.. _newstyle:
@@ -1128,8 +1108,6 @@
new-style classes. This change will probably only be feasible in Python 3.0.
new-style classic old-style
-.. % =========================================================================
-
.. _specialnames:
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 0f45f94..ea2bb1a 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -105,8 +105,6 @@
defined truncation may happen. If the class name consists only of underscores,
no transformation is done.
-.. %
-.. %
.. _atom-literals:
@@ -979,6 +977,10 @@
.. _comparisons:
+.. _is:
+.. _isnot:
+.. _in:
+.. _notin:
Comparisons
===========
@@ -1108,6 +1110,9 @@
.. _booleans:
+.. _and:
+.. _or:
+.. _not:
Boolean operations
==================
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 09b8288..7857887 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -131,7 +131,7 @@
original encoding before interpretation starts. The encoding declaration must
appear on a line of its own.
-.. % XXX there should be a list of supported encodings.
+.. XXX there should be a list of supported encodings.
.. _explicit-joining:
@@ -149,11 +149,7 @@
characters (``\``), as follows: when a physical line ends in a backslash that is
not part of a string literal or comment, it is joined with the following forming
a single logical line, deleting the backslash and the following end-of-line
-character. For example:
-
-.. %
-
-::
+character. For example::
if 1900 < year < 2100 and 1 <= month <= 12 \
and 1 <= day <= 31 and 0 <= hour < 24 \
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 69bcd9d..513543b 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -142,8 +142,6 @@
for the object previously bound to the name to reach zero, causing the object to
be deallocated and its destructor (if it has one) to be called.
- .. % nested
-
* If the target is a target list enclosed in parentheses or in square brackets:
The object must be a sequence with the same number of items as there are targets
in the target list, and its items are assigned, from left to right, to the
@@ -295,16 +293,16 @@
single: __debug__
exception: AssertionError
-These equivalences assume that ``__debug__`` and :exc:`AssertionError` refer to
+These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to
the built-in variables with those names. In the current implementation, the
-built-in variable ``__debug__`` is ``True`` under normal circumstances,
+built-in variable :const:`__debug__` is ``True`` under normal circumstances,
``False`` when optimization is requested (command line option -O). The current
code generator emits no code for an assert statement when optimization is
requested at compile time. Note that it is unnecessary to include the source
code for the expression that failed in the error message; it will be displayed
as part of the stack trace.
-Assignments to ``__debug__`` are illegal. The value for the built-in variable
+Assignments to :const:`__debug__` are illegal. The value for the built-in variable
is determined when the interpreter starts.
@@ -634,6 +632,7 @@
.. _import:
+.. _from:
The :keyword:`import` statement
===============================
@@ -755,8 +754,6 @@
http://www.python.org/doc/essays/packages.html for more details, also about how
the module search works from inside a package.]
-.. %
-
.. index:: builtin: __import__
The built-in function :func:`__import__` is provided to support applications