]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update comments about the performance of xrange().
authorRaymond Hettinger <python@rcn.com>
Wed, 11 Dec 2002 07:14:03 +0000 (07:14 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 11 Dec 2002 07:14:03 +0000 (07:14 +0000)
Doc/lib/libstdtypes.tex
Objects/rangeobject.c

index 4372ec17cabb0f6ab3503b5f0756d75a8ff85cf7..a104d85847f0f5c516bb69ef2880afb6d3176c67 100644 (file)
@@ -884,8 +884,8 @@ xrange object will always take the same amount of memory, no matter the
 size of the range it represents.  There are no consistent performance
 advantages.
 
-XRange objects have very little behavior: they only support indexing
-and the \function{len()} function.
+XRange objects have very little behavior: they only support indexing,
+iteration, and the \function{len()} function.
 
 
 \subsubsection{Mutable Sequence Types \label{typesseq-mutable}}
index 9d0d9cd4f278fa9527286e4df329eb6218460577..9c7b74eb2d4cd625c590c03dfee105dd7018f895 100644 (file)
@@ -113,8 +113,8 @@ PyDoc_STRVAR(range_doc,
 "xrange([start,] stop[, step]) -> xrange object\n\
 \n\
 Like range(), but instead of returning a list, returns an object that\n\
-generates the numbers in the range on demand.  This is slightly slower\n\
-than range() but more memory efficient.");
+generates the numbers in the range on demand.  For looping, this is \n\
+slightly faster than range() and more memory efficient.");
 
 static PyObject *
 range_item(rangeobject *r, int i)