Kaydet (Commit) d2bef825 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Update comments about the performance of xrange().

üst 39c7b459
...@@ -884,8 +884,8 @@ xrange object will always take the same amount of memory, no matter the ...@@ -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 size of the range it represents. There are no consistent performance
advantages. advantages.
XRange objects have very little behavior: they only support indexing XRange objects have very little behavior: they only support indexing,
and the \function{len()} function. iteration, and the \function{len()} function.
\subsubsection{Mutable Sequence Types \label{typesseq-mutable}} \subsubsection{Mutable Sequence Types \label{typesseq-mutable}}
......
...@@ -113,8 +113,8 @@ PyDoc_STRVAR(range_doc, ...@@ -113,8 +113,8 @@ PyDoc_STRVAR(range_doc,
"xrange([start,] stop[, step]) -> xrange object\n\ "xrange([start,] stop[, step]) -> xrange object\n\
\n\ \n\
Like range(), but instead of returning a list, returns an object that\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\ generates the numbers in the range on demand. For looping, this is \n\
than range() but more memory efficient."); slightly faster than range() and more memory efficient.");
static PyObject * static PyObject *
range_item(rangeobject *r, int i) range_item(rangeobject *r, int i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment