Sliceable

“sliceable” makes it possible to apply Python’s slice and stride notation to iterables. The following examples illustrate this:

Access via Index

>>> pos_list = sliceable(scan(1, 3))

>>> pos_list[0]
1

>>> pos_list[3]
7

>>> pos_list.next()
1

>>> pos_list[0]
1

Slice

>>> pos_list = sliceable(scan(1, 3))

>>> pos_list[1:3]
[3, 5]

Slice with Stride

>>> pos_list = sliceable(scan(1, 3))

>>> pos_list[1:4:2]
[3, 7]

Table Of Contents

Previous topic

Scan

Next topic

Chainable

This Page