“scan” provides simple means to define various types of series. The following examples illustrate this better.
>>> pos_list = scan(1, 2) # returns a generator
>>> pos_list.next()
1
>>> pos_list.next()
2
>>> pos_list.next()
3
>>> neg_list = scan(-2, -5)
>>> neg_list.next()
-2
>>> neg_list.next()
-5
>>> neg_list.next()
-8
>>> c_list = scan(7, 7)
>>> c_list.next()
7
>>> c_list.next()
7
>>> c_list.next()
7
>>> fibo = scan(0, 1, lambda a, b: a + b)
>>> fibo.next()
0
>>> fibo.next()
1
>>> fibo.next()
1
>>> fibo.next()
2