itertools comments [Was: Re: RELEASED: Python 2.3a2]
cnetzer at mail.arc.nasa.gov
Fri Feb 21 03:31:17 CET 2003
On Thu, 2003-02-20 at 17:30, Raymond Hettinger wrote:
> From: "Chad Netzer"
> > Would you be open to having an irange() call, that could be used instead
> > of xrange(), and would be able to return long integers (perhaps only
> > when appropriate)?
> I recommend addressing the problem directly and posting a feature
> request or patch for changes to range() or xrange().
Right. I'll finish up work on the range() patch for 2.3, and submit.
The changes required to support the long integers for xrange() have been
discussed in the past, and are hairy. I never bothered finishing, as
the changes were just too invasive (and therefore unlikely to be
accepted for what is arguably a small gain for most).
An xlrange() in pure python is easy to implement, and I'll work on a
C-based irange() for consideration in itertools. itertools at least
provides a sensible namespace for it (though I'd understand if you
considered it pollution, and rejected it as such.:) I'll try to state
my case with simple, maintainable code before any further debate on the
matter. Regardless, I think the range() change should only be accepted
into the core if an xlrange() type functionality (whether it is called
xlrange(), irange(), etc.) is also made available, simply for
Bay Area Python Interest Group - http://www.baypiggies.net/
(any opinion expressed is my own and not NASA's or my employer's)
More information about the Python-list