generator = cycle([[0, 3], [1, 0], [3, 1]], 0, Ellipsis)
next(generator)
0
next(generator)
3
next(generator)
1
next(generator)
0
next(generator)
3
next(generator)
1
next(generator)
0
next(generator)
3
How to join links in Python to get a cycle?