@@ -19,10 +19,10 @@ class ParallelProcessing: ...
1919from .utils .config import Settings
2020from .utils .algorithm import chunk_split
2121
22- from ._types import ThreadStatus , Data_In , Data_Out , Overflow_In , HookFunction
22+ from ._types import ThreadStatus , Data_In , Data_Out , Overflow_In , TargetFunction , HookFunction
2323from typing import (
2424 Any , List ,
25- Callable , Union , Optional ,
25+ Callable , Optional ,
2626 Mapping , Sequence , Tuple
2727)
2828
@@ -51,7 +51,7 @@ class Thread(threading.Thread):
5151
5252 def __init__ (
5353 self ,
54- target : Callable [..., Data_Out ] ,
54+ target : TargetFunction ,
5555 args : Sequence [Data_In ] = (),
5656 kwargs : Mapping [str , Data_In ] = {},
5757 ignore_errors : Sequence [type [Exception ]] = (),
@@ -100,7 +100,7 @@ def __init__(
100100 )
101101
102102
103- def _wrap_target (self , target : Callable [..., Data_Out ] ) -> Callable [..., Data_Out ] :
103+ def _wrap_target (self , target : TargetFunction ) -> TargetFunction :
104104 """Wraps the target function"""
105105 @wraps (target )
106106 def wrapper (* args : Any , ** kwargs : Any ) -> Any :
@@ -344,7 +344,7 @@ class ParallelProcessing:
344344
345345 def __init__ (
346346 self ,
347- function : Callable [..., Data_Out ] ,
347+ function : TargetFunction ,
348348 dataset : Sequence [Data_In ],
349349 max_threads : int = 8 ,
350350
@@ -385,7 +385,7 @@ def __init__(
385385
386386 def _wrap_function (
387387 self ,
388- function : Callable [..., Data_Out ]
388+ function : TargetFunction
389389 ) -> Callable [..., List [Data_Out ]]:
390390 @wraps (function )
391391 def wrapper (index : int , data_chunk : Sequence [Data_In ], * args : Any , ** kwargs : Any ) -> List [Data_Out ]:
0 commit comments