Author ncoghlan
Recipients ncoghlan
Date 2011-01-11.15:59:27
SpamBayes Score 0.000112868
Marked as misclassified No
Message-id <1294761569.28.0.225841776524.issue10889@psf.upfronthosting.co.za>
In-reply-to
Content
Enhancement to range to correctly handle indexing and slicing when len(x) raises OverflowError.

Note that this enables correct calculation of the length of such ranges via:

        def _range_len(x):
            try:
                length = len(x)
            except OverflowError:
                step = x[1] - x[0]
                length = 1 + ((x[-1] - x[0]) // step)
            return length
History
Date User Action Args
2011-01-11 15:59:29ncoghlansetrecipients: + ncoghlan
2011-01-11 15:59:29ncoghlansetmessageid: <1294761569.28.0.225841776524.issue10889@psf.upfronthosting.co.za>
2011-01-11 15:59:27ncoghlanlinkissue10889 messages
2011-01-11 15:59:27ncoghlancreate