Skip to content

Instantly share code, notes, and snippets.

@artturijalli
Created July 6, 2021 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artturijalli/2c80f4a538e1d438ea9627b36992dc9f to your computer and use it in GitHub Desktop.
Save artturijalli/2c80f4a538e1d438ea9627b36992dc9f to your computer and use it in GitHub Desktop.
class InfiniteSupply:
def __init__(self, start):
self.current = start
def __iter__(self):
return self
def __next__(self):
value = self.current
self.current += 1
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment