diff --git a/voussoirkit/gentools.py b/voussoirkit/gentools.py index c271640..1f48472 100644 --- a/voussoirkit/gentools.py +++ b/voussoirkit/gentools.py @@ -13,3 +13,11 @@ def chunk_generator(sequence, chunk_length): if not chunk: break 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