[Python-ideas] Float range class

Chris Angelico rosuav at gmail.com
Fri Jan 9 12:33:31 CET 2015


On Fri, Jan 9, 2015 at 10:28 PM, M.-A. Lemburg <mal at egenix.com> wrote:
> Probably 95% of all uses of range() in my own code never use range
> object features beyond that of being iterable. For everything
> else you can create either a list or throw itertools at it :-)
>
> IMO, the only reason for having an frange() function in (probably)
> the math module is to provide an implementation which tries to
> reduce fp rounding problems to a minimum.

Sure, and that's doubtless very useful. But that can't be described as
"something that
is, as much as possible, identical to the existing range". It's a very
specific subset - one that happens to be the most-used aspect of
range(), but a subset nonetheless.

ChrisA


More information about the Python-ideas mailing list