From: Guido van Rossum Date: Thu, 24 Feb 1994 11:28:27 +0000 (+0000) Subject: Documented xrange; crossreffed lambda a bit more X-Git-Tag: v1.0.2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68cfbe7c93f8525da14ef419940df3c4b81f1ff4;p=thirdparty%2FPython%2Fcpython.git Documented xrange; crossreffed lambda a bit more --- diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index e0b36f33d7bc..73bc1454b70f 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -354,3 +354,15 @@ its goal is to return a printable string. >>> if type(x) == type(''): print 'It is a string' \end{verbatim}\ecode \end{funcdesc} + +\begin{funcdesc}{xrange}{start\, end\, step} +This function is very similar to \code{range()}, but returns an +``xrange object'' instead of a list. This is an opaque sequence type +which yields the same values as the corresponding list, without +actually storing them all simultaneously. The advantage of +\code{xrange()} over \code{range()} is minimal (since \code{xrange()} +still has to create the values when asked for them) except when a very +large range is used on a memory-starved machine (e.g. DOS) or when all +of the range's elements are never used (e.g. when the loop is usually +terminated with \code{break}). +\end{funcdesc} diff --git a/Doc/libfuncs.tex b/Doc/libfuncs.tex index e0b36f33d7bc..73bc1454b70f 100644 --- a/Doc/libfuncs.tex +++ b/Doc/libfuncs.tex @@ -354,3 +354,15 @@ its goal is to return a printable string. >>> if type(x) == type(''): print 'It is a string' \end{verbatim}\ecode \end{funcdesc} + +\begin{funcdesc}{xrange}{start\, end\, step} +This function is very similar to \code{range()}, but returns an +``xrange object'' instead of a list. This is an opaque sequence type +which yields the same values as the corresponding list, without +actually storing them all simultaneously. The advantage of +\code{xrange()} over \code{range()} is minimal (since \code{xrange()} +still has to create the values when asked for them) except when a very +large range is used on a memory-starved machine (e.g. DOS) or when all +of the range's elements are never used (e.g. when the loop is usually +terminated with \code{break}). +\end{funcdesc}