[Python-ideas] Add irange with large integer step support to itertools

Martin Manns mmanns at gmx.net
Mon Jan 10 18:01:35 CET 2011

On Mon, 10 Jan 2011 21:52:36 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:

> > Wouldn't it be better to fix 'range' to behave as expected?
> Agreed. It isn't a deliberate design limitation - it's just a
> consequence of the fact that converting from C integer programming to
> PyLong programming is a PITA, so it has been a process of progressive
> upgrades in range's support for values that don't fit in sys.maxsize.


So the limitations is not a deliberate design choice. 
Looking at the tracker, a fix would probably be covered by issue2690.

I see that you have provided a patch there on Dec. 3. However, this
patch either does not address the problem or it has not been committed
to Py3k, yet. I checked Py3k with an svn dump and it shows the same
behavior as Python 3.1.

original message by Nick Coghlan in issue2690:

> "I brought the patch up to date for the Py3k branch, but realised just
> before checking it in that it may run afoul of the language moratorium
> (since it alters the behaviour of builtin range objects)."

Does the patch address the issue or is it a more complicated problem?

If the former is the case then could issue2690 be re-opened and the
patch committed?

However, if the latter is the case then I still would like to propose
at least adding a snippet to the itertools docs because fixing the
issue properly could take its time.



More information about the Python-ideas mailing list