@@ -79,7 +79,7 @@ def __init__(
7979 self .mgr = None
8080
8181 self .tasks : List [Task ] = []
82- self .output : List [tuple ] = []
82+ self .output : List [Tuple ] = []
8383
8484 # Minimum number of tasks to run concurrently.
8585 self .min_concurrent_count : int = self .optimal_process_count ()
@@ -127,7 +127,7 @@ def add_process(self, process: Process, queue: Queue, subtasks: int = 0) -> None
127127 def add (
128128 self ,
129129 target : Callable ,
130- args : tuple = (),
130+ args : Tuple = (),
131131 subtasks : int = 0 ,
132132 process_type : Type = multiprocessing .Process ,
133133 queue_type : Type = multiprocessing .Queue ,
@@ -161,7 +161,7 @@ async def map(
161161 subtasks : int = 0 ,
162162 process_type : Type = multiprocessing .Process ,
163163 queue_type : Type = multiprocessing .Queue ,
164- ) -> List [Tuple ]:
164+ ) -> Union [ List [Tuple ], List [ Any ] ]:
165165 """
166166 Maps arguments over a single function. Each item in 'args' will be used
167167 as the input for a single process.
@@ -194,7 +194,7 @@ def map_blocking(
194194 subtasks : int = 0 ,
195195 process_type : Type = multiprocessing .Process ,
196196 queue_type : Type = multiprocessing .Queue ,
197- ) -> List [Tuple ]:
197+ ) -> Union [ List [Tuple ], List [ Any ] ]:
198198 """
199199 Equivalent to 'map()', but blocking.
200200
@@ -236,7 +236,7 @@ def add_tasks(self, *args: Task) -> None:
236236
237237 self .tasks .extend (args )
238238
239- async def run (self ) -> List [tuple ]:
239+ async def run (self ) -> Union [ List [Tuple ], List [ Any ] ]:
240240 """
241241 Runs the tasks in a coroutine.
242242
@@ -260,7 +260,7 @@ async def run(self) -> List[tuple]:
260260
261261 return self .output
262262
263- def run_blocking (self ) -> List [tuple ]:
263+ def run_blocking (self ) -> Union [ List [Tuple ], List [ Any ] ]:
264264 """
265265 Runs the tasks. Will block the current thread until all tasks are complete.
266266
0 commit comments