mirror of https://github.com/python/cpython
Update comments about the performance of xrange().
This commit is contained in:
parent
39c7b45964
commit
d2bef8256b
|
@ -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}}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue