[issue1533] Bug in range() function for large values

Alexander Belopolsky report at bugs.python.org
Sat May 1 04:01:21 CEST 2010


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

I agree that this issue should be closed with no further action, but for historical accuracy the resolution should be "out of date" rather than "won't fix".  The original bug was about range() behavior when it get arguments that are not ints, but "coerce-able into ints via __int__".  Since range() no longer accepts such arguments, the issue is moot and there is nothing to fix or not fix here.

As a pie in the sky idea, I always wanted a range function that would work on any arguments that support addition and ordering.  For example range(date(2010,1,1), date(2010, 2, 1), timedelta(7)) to return all Fridays in January, 2010.  However, since advent of generator functions, this became simply

def range(start, stop, step):
   while start < stop:
      yield start
      start += step

and thus unnecessary for stdlib.

----------
nosy: +Alexander.Belopolsky -belopolsky
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1533>
_______________________________________


More information about the Python-bugs-list mailing list