[Python-checkins] python/dist/src/Doc/tut tut.tex,1.247,1.248
jlgijsbers at users.sourceforge.net
jlgijsbers at users.sourceforge.net
Sat Sep 11 19:48:25 CEST 2004
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27414
Modified Files:
tut.tex
Log Message:
Patch #1025795: clarify language in Data Structures chapter of tutorial:
- Dictionary keys are in arbitrary order, but not random (which implies, well,
intentional randomness).
- Move a footnote closer to what it's talking about so that it doesn't look
like we're saying that "0 == 0.0" can't be relied on.
- Minor language tweaks in the vicinity.
Thanks Dima Dorfman!
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -d -r1.247 -r1.248
--- tut.tex 22 Aug 2004 15:24:33 -0000 1.247
+++ tut.tex 11 Sep 2004 17:48:21 -0000 1.248
@@ -2122,7 +2122,7 @@
value using a non-existent key.
The \method{keys()} method of a dictionary object returns a list of all
-the keys used in the dictionary, in random order (if you want it
+the keys used in the dictionary, in arbitrary order (if you want it
sorted, just apply the \method{sort()} method to the list of keys). To
check whether a single key is in the dictionary, use the
\method{has_key()} method of the dictionary.
@@ -2231,8 +2231,8 @@
\section{More on Conditions \label{conditions}}
-The conditions used in \code{while} and \code{if} statements above can
-contain other operators besides comparisons.
+The conditions used in \code{while} and \code{if} statements can
+contain any operators, not just comparisons.
The comparison operators \code{in} and \code{not in} check whether a value
occurs (does not occur) in a sequence. The operators \code{is} and
@@ -2247,11 +2247,11 @@
Comparisons may be combined by the Boolean operators \code{and} and
\code{or}, and the outcome of a comparison (or of any other Boolean
-expression) may be negated with \code{not}. These all have lower
-priorities than comparison operators again; between them, \code{not} has
-the highest priority, and \code{or} the lowest, so that
-\code{A and not B or C} is equivalent to \code{(A and (not B)) or C}. Of
-course, parentheses can be used to express the desired composition.
+expression) may be negated with \code{not}. These have lower
+priorities than comparison operators; between them, \code{not} has
+the highest priority and \code{or} the lowest, so that
+\code{A and not B or C} is equivalent to \code{(A and (not B)) or C}.
+As always, parentheses can be used to express the desired composition.
The Boolean operators \code{and} and \code{or} are so-called
\emph{short-circuit} operators: their arguments are evaluated from
@@ -2307,12 +2307,12 @@
Note that comparing objects of different types is legal. The outcome
is deterministic but arbitrary: the types are ordered by their name.
Thus, a list is always smaller than a string, a string is always
-smaller than a tuple, etc. Mixed numeric types are compared according
-to their numeric value, so 0 equals 0.0, etc.\footnote{
+smaller than a tuple, etc. \footnote{
The rules for comparing objects of different types should
not be relied upon; they may change in a future version of
the language.
-}
+} Mixed numeric types are compared according to their numeric value, so
+0 equals 0.0, etc.
\chapter{Modules \label{modules}}
More information about the Python-checkins
mailing list