Last active
August 20, 2018 21:57
-
-
Save yamad/980b413e20db19e40cae2a527fe3c522 to your computer and use it in GitHub Desktop.
my python zip
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 myzip(*args): | |
iters = [iter(a) for a in args] | |
while True: | |
try: | |
yield tuple([next(it) for it in iters]) | |
except StopIteration: | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment