On 3/4/07, Alan G Isaac <[EMAIL PROTECTED]> wrote:

On Sun, 4 Mar 2007, Charles R Harris apparently wrote:
> range is now iterable and I read
> somewhere that xrange is deprecated.

There has been a rumor that range will effectively become
xrange in Python 300
http://www.python.org/doc/essays/ppt/accu2006/Py3kACCU.ppt
but range has always been iterable---did you mean to say
"iterator"? but xrange objects to not support a next()
method either---and as of Python 2.5 xrange is not
deprecated (unless the documentation somehow got out of
sync).
http://docs.python.org/lib/built-in-funcs.html


My impression was that the traditional range returned a list and then the
iteration proceeded over the list, and that has changed, just as it is no
longer necessary to use the xreadlines method for files to iterate over the
lines. I don't recall where I read this stuff. Hmm, but maybe you are right,
that this is planned for python 3.0 but maybe not yet in current versions of
python. From a ppt presentation by Guido:

dict.keys(), range(), zip() won't return lists
killing dict.iterkeys(), xrange(), itertools.izip()

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to