[Numpy-discussion] First Numerical Python code...comments?
Charles R Harris
Sun Mar 4 11:46:55 CST 2007
On 3/4/07, Alan G Isaac <email@example.com> 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
> 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
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()
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion