This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients ncoghlan
Date 2011-01-11.15:59:27
SpamBayes Score 0.00011286839
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