Skip to content

Commit d0e8877

Browse files
refactor: Update signature to accept generator
1 parent 339a964 commit d0e8877

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/thread/thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ParallelProcessing: ...
3232
HookFunction,
3333
)
3434
from typing_extensions import Generic, ParamSpec
35-
from typing import List, Callable, Optional, Union, Mapping, Sequence, Tuple
35+
from typing import List, Callable, Optional, Union, Mapping, Sequence, Tuple, Generator
3636

3737

3838
Threads: set['Thread'] = set()
@@ -387,7 +387,7 @@ def _wrap_function(self, function: TargetFunction) -> TargetFunction:
387387
@wraps(function)
388388
def wrapper(
389389
index: int,
390-
data_chunk: Sequence[_Dataset_T],
390+
data_chunk: Generator[_Dataset_T, None, None],
391391
*args: _Target_P.args,
392392
**kwargs: _Target_P.kwargs,
393393
) -> List[_Target_T]:

0 commit comments

Comments
 (0)