Skip to content

Instantly share code, notes, and snippets.

@clbarnes
Created March 10, 2016 16:56
Show Gist options
  • Save clbarnes/5eadcd494f9fb790d152 to your computer and use it in GitHub Desktop.
Save clbarnes/5eadcd494f9fb790d152 to your computer and use it in GitHub Desktop.
Loop through a sequence forever.
def cycle_gen(sequence):
while True:
yield from sequence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment