Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68cfbe7

Browse files
committed
Documented xrange; crossreffed lambda a bit more
1 parent 9f65ae0 commit 68cfbe7

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Doc/lib/libfuncs.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,15 @@ \section{Built-in Functions}
354354
>>> if type(x) == type(''): print 'It is a string'
355355
\end{verbatim}\ecode
356356
\end{funcdesc}
357+
358+
\begin{funcdesc}{xrange}{start\, end\, step}
359+
This function is very similar to \code{range()}, but returns an
360+
``xrange object'' instead of a list. This is an opaque sequence type
361+
which yields the same values as the corresponding list, without
362+
actually storing them all simultaneously. The advantage of
363+
\code{xrange()} over \code{range()} is minimal (since \code{xrange()}
364+
still has to create the values when asked for them) except when a very
365+
large range is used on a memory-starved machine (e.g. DOS) or when all
366+
of the range's elements are never used (e.g. when the loop is usually
367+
terminated with \code{break}).
368+
\end{funcdesc}

Doc/libfuncs.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,15 @@ \section{Built-in Functions}
354354
>>> if type(x) == type(''): print 'It is a string'
355355
\end{verbatim}\ecode
356356
\end{funcdesc}
357+
358+
\begin{funcdesc}{xrange}{start\, end\, step}
359+
This function is very similar to \code{range()}, but returns an
360+
``xrange object'' instead of a list. This is an opaque sequence type
361+
which yields the same values as the corresponding list, without
362+
actually storing them all simultaneously. The advantage of
363+
\code{xrange()} over \code{range()} is minimal (since \code{xrange()}
364+
still has to create the values when asked for them) except when a very
365+
large range is used on a memory-starved machine (e.g. DOS) or when all
366+
of the range's elements are never used (e.g. when the loop is usually
367+
terminated with \code{break}).
368+
\end{funcdesc}

0 commit comments

Comments
 (0)