[Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.29,1.30

Fred L. Drake python-dev@python.org
Mon, 14 Aug 2000 08:38:02 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv32041/Doc/lib

Modified Files:
	libstdtypes.tex 
Log Message:

Document the range type, as suggested by Denis S. Otkidach
<den@analyt.chem.msu.ru>.


Index: libstdtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** libstdtypes.tex	2000/08/12 03:36:23	1.29
--- libstdtypes.tex	2000/08/14 15:37:59	1.30
***************
*** 313,318 ****
  \subsection{Sequence Types \label{typesseq}}
  
! There are five sequence types: strings, Unicode strings, lists,
! tuples, and buffers.
  
  Strings literals are written in single or double quotes:
--- 313,318 ----
  \subsection{Sequence Types \label{typesseq}}
  
! There are six sequence types: strings, Unicode strings, lists,
! tuples, buffers, and ranges.
  
  Strings literals are written in single or double quotes:
***************
*** 328,332 ****
  item tuple must have a trailing comma, e.g., \code{(d,)}.  Buffers are
  not directly support by Python syntax, but can created by calling the
! builtin function \function{buffer()}.\bifuncindex{buffer}
  \indexii{sequence}{types}
  \indexii{string}{type}
--- 328,335 ----
  item tuple must have a trailing comma, e.g., \code{(d,)}.  Buffers are
  not directly support by Python syntax, but can created by calling the
! builtin function \function{buffer()}.\bifuncindex{buffer}  Ranges are
! similar to buffers in that there is no specific syntax to create them,
! but they are created using the \function{xrange()}
! function.\bifuncindex{xrange}
  \indexii{sequence}{types}
  \indexii{string}{type}
***************
*** 631,637 ****
  
  Additional string operations are defined in standard module
! \module{string} and in built-in module \module{re}.
  \refstmodindex{string}
  \refstmodindex{re}
  
  \subsubsection{Mutable Sequence Types \label{typesseq-mutable}}
--- 634,657 ----
  
  Additional string operations are defined in standard module
! \refmodule{string} and in built-in module \refmodule{re}.
  \refstmodindex{string}
  \refstmodindex{re}
+ 
+ 
+ \subsubsection{Range Type \label{typesseq-range}}
+ 
+ The range\indexii{range}{type} type is an immutable sequence which is
+ commonly used for looping.  The advantage of the range type is that a
+ range object will always take the same amount of memory, no matter the
+ size of the range it represents.  There are no consistent performance
+ advantages.
+ 
+ Range objects behave like tuples, and offer a single method:
+ 
+ \begin{methoddesc}[range]{tolist}{}
+   Return a list object which represents the same values as the range
+   object.
+ \end{methoddesc}
+ 
  
  \subsubsection{Mutable Sequence Types \label{typesseq-mutable}}