Last active
June 24, 2020 01:16
-
-
Save pgmmpk/70a5965c3685166671294dd27b584623 to your computer and use it in GitHub Desktop.
forever loop with iterator factory
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
def forever(factory, *av, **kav): | |
yield from factory(*av, **kav) | |
.. | |
for item in forever(read_blocked_dataset, ds, partition, compression='gzip'): | |
print(item) # this repeats forever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment