This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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