@@ -25,7 +25,7 @@ class ParallelProcessing: ...
25
25
DatasetFunction , _Dataset_T ,
26
26
HookFunction
27
27
)
28
- from typing_extensions import Generic
28
+ from typing_extensions import Generic , Concatenate , ParamSpec
29
29
from typing import (
30
30
List ,
31
31
Callable , Optional , Union ,
@@ -321,6 +321,7 @@ def start(self) -> None:
321
321
322
322
323
323
324
+ _P = ParamSpec ('_P' )
324
325
class _ThreadWorker :
325
326
progress : float
326
327
thread : Thread
@@ -341,7 +342,7 @@ class ParallelProcessing(Generic[_Target_P, _Target_T, _Dataset_T]):
341
342
_completed : int
342
343
343
344
status : ThreadStatus
344
- function : TargetFunction [..., List [ _Target_T ]]
345
+ function : TargetFunction
345
346
dataset : Sequence [Data_In ]
346
347
max_threads : int
347
348
@@ -391,8 +392,8 @@ def __init__(
391
392
392
393
def _wrap_function (
393
394
self ,
394
- function : TargetFunction [[ _Dataset_T ], _Target_T ]
395
- ) -> TargetFunction [..., List [ _Target_T ]] :
395
+ function : TargetFunction
396
+ ) -> TargetFunction :
396
397
@wraps (function )
397
398
def wrapper (index : int , data_chunk : Sequence [_Dataset_T ], * args : _Target_P .args , ** kwargs : _Target_P .kwargs ) -> List [_Target_T ]:
398
399
computed : List [Data_Out ] = []
@@ -512,6 +513,8 @@ def start(self) -> None:
512
513
name_format = self .overflow_kwargs .get ('name' ) and self .overflow_kwargs ['name' ] + '%s'
513
514
self .overflow_kwargs = { i : v for i ,v in self .overflow_kwargs .items () if i != 'name' and i != 'args' }
514
515
516
+ print (parsed_args , self .overflow_args )
517
+
515
518
for i , data_chunk in enumerate (chunk_split (self .dataset , max_threads )):
516
519
chunk_thread = Thread (
517
520
target = self .function ,
0 commit comments