Add gentools.run.
This commit is contained in:
parent
8eed09c14b
commit
ccd3bf72c0
1 changed files with 8 additions and 0 deletions
|
@ -13,3 +13,11 @@ def chunk_generator(sequence, chunk_length):
|
||||||
if not chunk:
|
if not chunk:
|
||||||
break
|
break
|
||||||
yield chunk
|
yield chunk
|
||||||
|
|
||||||
|
def run(g) -> None:
|
||||||
|
'''
|
||||||
|
Iterate the generator and discard the results. Used when the generator has
|
||||||
|
side effects that are more important than the yielded values.
|
||||||
|
'''
|
||||||
|
for x in g:
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in a new issue