Message126017
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 |
|
Date |
User |
Action |
Args |
2011-01-11 15:59:29 | ncoghlan | set | recipients:
+ ncoghlan |
2011-01-11 15:59:29 | ncoghlan | set | messageid: <1294761569.28.0.225841776524.issue10889@psf.upfronthosting.co.za> |
2011-01-11 15:59:27 | ncoghlan | link | issue10889 messages |
2011-01-11 15:59:27 | ncoghlan | create | |
|