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

Nick Coghlan ncoghlan at gmail.com
Mon Jan 10 18:42:43 CET 2011

On Tue, Jan 11, 2011 at 3:01 AM, Martin Manns <mmanns at gmx.net> wrote:
> 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?

It's a separate problem. Last paragraph of the message you quoted:

>>Note that I also fixed the patch so that OverflowError occurs only when encountering an affected operation (primarily indexing and retrieval of the length). If you don't do any of those things, you can make your ranges as large as you like. (The indexing could fairly easily be fixed to eliminate the overflow errors - I just didn't do it in this patch, since it is a separate problem).

> 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.

It's a separate issue. In the meantime, a recipe on the Python
Cookbook would probably be the most appropriate way to handle it.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list