From d2bef8256bf7ce6bea7a80074cbd021b5af154af Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 11 Dec 2002 07:14:03 +0000 Subject: Update comments about the performance of xrange(). --- Doc/lib/libstdtypes.tex | 4 ++-- Objects/rangeobject.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index 4372ec1..a104d85 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -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}} diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 9d0d9cd..9c7b74e 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -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) -- cgit v0.12