Skip to content
Snippets Groups Projects
Commit 24b5cc34 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

added `run_when_iterator_completes`

parent 9caec1e7
No related branches found
No related tags found
No related merge requests found
Pipeline #64021 passed with stages
in 2 minutes and 42 seconds
......@@ -67,7 +67,7 @@ class RunActionAfterGeneratorCompletes(tp.Generator, metaclass=ABCMeta):
"""This will run when this generator completes. Override it."""
def run_when_generator_completes(gen: tp.Generator, call_on_done: tp.Callable[[...], None],
def run_when_generator_completes(gen: tp.Generator, call_on_done: tp.Callable,
*args, **kwargs) -> RunActionAfterGeneratorCompletes:
"""
Return the generator with call_on_done to be called on when it finishes
......
......@@ -138,7 +138,7 @@ class hint_with_length:
return self.length
def run_when_iterator_completes(iterator, func_to_run, *args, **kwargs):
def run_when_iterator_completes(iterator: tp.Iterator, func_to_run: tp.Callable, *args, **kwargs):
"""
Schedule a function to be called when an iterator completes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment