This seems kind of complicated compared to something like this:
def cycle(seq):
"Generator that yields the elements of a non-empty sequence cyclically."
i = 0
while True:
yield seq[i]
i = (i + 1) % len(seq)
Or, as Joe Wallis points out in comments:
def cycle(seq):
"Generator that yields the elements of a non-empty sequence cyclically."
while True:
yield from seq