[Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.20.2.6,1.20.2.7
Fred L. Drake
fdrake@weyr.cnri.reston.va.us
Thu, 16 Mar 2000 15:34:27 -0500 (EST)
Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory weyr:/home/fdrake/projects/python/Doc-152p2/lib
Modified Files:
Tag: release152p1-patches
libstdtypes.tex
Log Message:
Made a few small clarifications based on comments from Jim Kerr
<jim_kerr@agilent.com>.
Fixed a few even smaller markup nits as well.
Index: libstdtypes.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libstdtypes.tex,v
retrieving revision 1.20.2.6
retrieving revision 1.20.2.7
diff -C2 -r1.20.2.6 -r1.20.2.7
*** libstdtypes.tex 2000/03/15 17:12:33 1.20.2.6
--- libstdtypes.tex 2000/03/16 20:34:24 1.20.2.7
***************
*** 39,43 ****
\item instances of user-defined classes, if the class defines a
\method{__nonzero__()} or \method{__len__()} method, when that
! method returns zero.
\end{itemize}
--- 39,44 ----
\item instances of user-defined classes, if the class defines a
\method{__nonzero__()} or \method{__len__()} method, when that
! method returns zero.\footnote{Additional information on these
! special methods may be found in the \emph{Python Reference Manual}.}
\end{itemize}
***************
*** 131,148 ****
compare equal; such objects are ordered consistently but arbitrarily
(so that sorting a heterogeneous array yields a consistent result).
! Furthermore, some types (e.g., windows) support only a degenerate
! notion of comparison where any two objects of that type are unequal.
! Again, such objects are ordered arbitrarily but consistently.
! \indexii{types}{numeric}
\indexii{objects}{comparing}
(Implementation note: objects of different types except numbers are
ordered by their type names; objects of the same types that don't
support proper comparison are ordered by their address.)
! Two more operations with the same syntactic priority, \samp{in} and
! \samp{not in}, are supported only by sequence types (below).
! \opindex{in}
! \opindex{not in}
--- 132,155 ----
compare equal; such objects are ordered consistently but arbitrarily
(so that sorting a heterogeneous array yields a consistent result).
! Furthermore, some types (for example, file objects) support only a
! degenerate notion of comparison where any two objects of that type are
! unequal. Again, such objects are ordered arbitrarily but
! consistently.
! \indexii{object}{numeric}
\indexii{objects}{comparing}
+ Instances of a class normally compare as non-equal unless the class
+ \withsubitem{(instance method)}{\ttindex{__cmp__()}}
+ defines the \method{__cmp__()} method. Refer to the \emph{Python
+ Reference Manual} for information on the use of this method to effect
+ object comparisons.
+
(Implementation note: objects of different types except numbers are
ordered by their type names; objects of the same types that don't
support proper comparison are ordered by their address.)
! Two more operations with the same syntactic priority,
! \samp{in}\opindex{in} and \samp{not in}\opindex{not in}, are supported
! only by sequence types (below).
***************
*** 152,158 ****
\dfn{floating point numbers}, and \dfn{complex numbers}.
Plain integers (also just called \dfn{integers})
! are implemented using \ctype{long} in \C{}, which gives them at least 32
bits of precision. Long integers have unlimited precision. Floating
! point numbers are implemented using \ctype{double} in \C{}. All bets on
their precision are off unless you happen to know the machine you are
working with.
--- 159,165 ----
\dfn{floating point numbers}, and \dfn{complex numbers}.
Plain integers (also just called \dfn{integers})
! are implemented using \ctype{long} in C, which gives them at least 32
bits of precision. Long integers have unlimited precision. Floating
! point numbers are implemented using \ctype{double} in C. All bets on
their precision are off unless you happen to know the machine you are
working with.
***************
*** 163,180 ****
\indexii{floating point}{type}
\indexii{complex number}{type}
! \indexii{C@\C{}}{language}
Complex numbers have a real and imaginary part, which are both
! implemented using \ctype{double} in \C{}. To extract these parts from
a complex number \var{z}, use \code{\var{z}.real} and \code{\var{z}.imag}.
Numbers are created by numeric literals or as the result of built-in
functions and operators. Unadorned integer literals (including hex
! and octal numbers) yield plain integers. Integer literals with an \samp{L}
! or \samp{l} suffix yield long integers
! (\samp{L} is preferred because \samp{1l} looks too much like eleven!).
! Numeric literals containing a decimal point or an exponent sign yield
! floating point numbers. Appending \samp{j} or \samp{J} to a numeric
! literal yields a complex number.
\indexii{numeric}{literals}
\indexii{integer}{literals}
--- 170,187 ----
\indexii{floating point}{type}
\indexii{complex number}{type}
! \indexii{C}{language}
Complex numbers have a real and imaginary part, which are both
! implemented using \ctype{double} in C. To extract these parts from
a complex number \var{z}, use \code{\var{z}.real} and \code{\var{z}.imag}.
Numbers are created by numeric literals or as the result of built-in
functions and operators. Unadorned integer literals (including hex
! and octal numbers) yield plain integers. Integer literals with an
! \character{L} or \character{l} suffix yield long integers
! (\character{L} is preferred because \samp{1l} looks too much like
! eleven!). Numeric literals containing a decimal point or an exponent
! sign yield floating point numbers. Appending \character{j} or
! \character{J} to a numeric literal yields a complex number.
\indexii{numeric}{literals}
\indexii{integer}{literals}