“sliceable” makes it possible to apply Python’s slice and stride notation to iterables. The following examples illustrate this:
>>> pos_list = sliceable(scan(1, 3))
>>> pos_list[0]
1
>>> pos_list[3]
7
>>> pos_list.next()
1
>>> pos_list[0]
1
>>> pos_list = sliceable(scan(1, 3))
>>> pos_list[1:3]
[3, 5]
>>> pos_list = sliceable(scan(1, 3))
>>> pos_list[1:4:2]
[3, 7]