Created
July 8, 2010 16:20
-
-
Save evilkost/468246 to your computer and use it in GitHub Desktop.
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 main_g(inp_iter, c): | |
while True: | |
count = [0,] | |
def inner_g(): | |
while count[0] < c: | |
yield inp_iter.next() | |
count[0] += 1 | |
else: | |
count[0] = 0 | |
raise StopIteration() | |
yield inner_g() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment