Commit 68cfbe7c authored by Guido van Rossum's avatar Guido van Rossum

Documented xrange; crossreffed lambda a bit more

parent 9f65ae00
......@@ -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}
......@@ -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}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment