diff options
author | Georg Brandl <georg@python.org> | 2007-12-29 10:57:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-12-29 10:57:00 (GMT) |
commit | b19be571e09263239ef29c92eee06dbb30186685 (patch) | |
tree | 9c8a5439b14ce34cfaa0e4e164483b0f8690aa42 /Doc/reference | |
parent | 28c7bcf38e1e69a9091cbba90b982331428ddbe6 (diff) | |
download | cpython-b19be571e09263239ef29c92eee06dbb30186685.zip cpython-b19be571e09263239ef29c92eee06dbb30186685.tar.gz cpython-b19be571e09263239ef29c92eee06dbb30186685.tar.bz2 |
Some cleanup in the docs.
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/compound_stmts.rst | 6 | ||||
-rw-r--r-- | Doc/reference/datamodel.rst | 22 | ||||
-rw-r--r-- | Doc/reference/expressions.rst | 9 | ||||
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 8 | ||||
-rw-r--r-- | Doc/reference/simple_stmts.rst | 11 |
5 files changed, 19 insertions, 37 deletions
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 @@ on a separate line for clarity. .. _if: +.. _elif: +.. _else: The :keyword:`if` statement =========================== @@ -206,6 +208,8 @@ effect of Pascal's ``for i := a to b do``; e.g., ``range(3)`` returns the list .. _try: +.. _except: +.. _finally: The :keyword:`try` statement ============================ @@ -320,6 +324,7 @@ may be found in section :ref:`raise`. .. _with: +.. _as: The :keyword:`with` statement ============================= @@ -386,6 +391,7 @@ The execution of the :keyword:`with` statement proceeds as follows: .. _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 @@ Numbers 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 @@ Numbers 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 @@ Sequences 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 @@ Sequences 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 @@ Set types :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 @@ Mappings 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 @@ Modules 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 @@ Internal types 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 @@ The plan is to eventually drop old-style classes, leaving only the semantics of 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 @@ transformed name is extremely long (longer than 255 characters), implementation defined truncation may happen. If the class name consists only of underscores, no transformation is done. -.. % -.. % .. _atom-literals: @@ -979,6 +977,10 @@ must be plain or long integers. The arguments are converted to a common type. .. _comparisons: +.. _is: +.. _isnot: +.. _in: +.. _notin: Comparisons =========== @@ -1108,6 +1110,9 @@ yields the inverse truth value. .. _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 @@ converted to Unicode for syntactical analysis, then converted back to their 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 @@ Two or more physical lines may be joined into logical lines using backslash 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 @@ Assignment of an object to a single target is recursively defined as follows. 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 @@ The extended form, ``assert expression1, expression2``, is equivalent to :: 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 @@ cycle of the nearest enclosing loop. .. _import: +.. _from: The :keyword:`import` statement =============================== @@ -755,8 +754,6 @@ bothered to spell this out right now; see the URL 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 |