You may create a function that creates a wrapping ...
# stdlib
o
You may create a function that creates a wrapping sequence which have a one element look-ahead, and when you iterate, you always yield previous one.