Maybe I'm too spoiled with the usual awesomeness of Python, but is there a more natural way to iterate over intervals of a list?
Instead of:
L = [12, 15, 29, 100, 239]
for i in range(len(L)-1):
print L[i], L[i+1]
12 15
15 29
29 100
100 239
is there somthing like this:
for i, j in intervals(L):
print i, j
?