Justin Azoff wrote: > Yes.. if they are sorted, something like this should work: Oops, that was almost right, but it would skip some ranges.
This should always work:
...
while 1:
try :
if a.intersects(b):
ret.append(a.intersection(b))
if a.end < b.end:
a = ai.next()
else :
b = bi.next()
elif a.start < b.start:
a = ai.next()
else :
b = bi.next()
except StopIteration:
break
return RangeList(ret)
--
- Justin
--
http://mail.python.org/mailman/listinfo/python-list
