[Python-checkins] cpython (2.7): Link to "XRange Type" section in xrange() built-in function documentation.
chris.jerdonek
python-checkins at python.org
Wed Nov 14 11:15:19 CET 2012
http://hg.python.org/cpython/rev/b25dcfe2b244
changeset: 80423:b25dcfe2b244
branch: 2.7
parent: 80408:bb21c800cf49
user: Chris Jerdonek <chris.jerdonek at gmail.com>
date: Wed Nov 14 02:13:28 2012 -0800
summary:
Link to "XRange Type" section in xrange() built-in function documentation.
files:
Doc/library/functions.rst | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1523,14 +1523,16 @@
.. function:: xrange(stop)
xrange(start, stop[, step])
- This function is very similar to :func:`range`, but returns an "xrange object"
+ This function is very similar to :func:`range`, but returns an :ref:`xrange
+ object <typesseq-xrange>`
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 :func:`xrange` over :func:`range` is minimal (since
:func:`xrange` still has to create the values when asked for them) except when a
very large range is used on a memory-starved machine or when all of the range's
elements are never used (such as when the loop is usually terminated with
- :keyword:`break`).
+ :keyword:`break`). For more information on xrange objects, see
+ :ref:`typesseq-xrange` and :ref:`typesseq`.
.. impl-detail::
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list