[issue7298] reversed(range(x, -1, -1)) is empty when x > 1

Mark Dickinson report at bugs.python.org
Fri Nov 13 23:17:20 CET 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks for reviewing, Eric.  I'll work a bit more on the tests.

I'm also not sure what to do about 2.x:  here reversed(xrange(start, 
stop, step)) has some of the same problems for large numbers. (E.g., if 
step == LONG_MIN.)

The options are: (1) have reversed(x) raise ValueError for some extreme 
xrange instances x, or (2) rework the internals so that reversed(x) 
always works.

Given that this is a bugfix, I'm inclined to go for (1) for now;  we can 
always look at reworking xrange later on, for 2.7 and 3.2.

----------

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


More information about the Python-bugs-list mailing list