Skip to content

Commit 3e375ed

Browse files
fix: Update function signature to support multiple arguments
1 parent 72f2217 commit 3e375ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/thread/_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
from typing import Any, Literal, Callable, Union
8-
from typing_extensions import ParamSpec, TypeVar
8+
from typing_extensions import ParamSpec, TypeVar, Concatenate
99

1010

1111
# Descriptive Types
@@ -34,4 +34,4 @@
3434
HookFunction = Callable[[_Target_T], Union[Any, None]]
3535

3636
_Dataset_T = TypeVar('_Dataset_T')
37-
DatasetFunction = Callable[[_Dataset_T], _Target_T]
37+
DatasetFunction = Callable[Concatenate[_Dataset_T, _Target_P], _Target_T]

src/thread/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class ParallelProcessing(Generic[_Target_P, _Target_T, _Dataset_T]):
346346

347347
def __init__(
348348
self,
349-
function: DatasetFunction[_Dataset_T, _Target_T],
349+
function: DatasetFunction[_Dataset_T, _Target_P, _Target_T],
350350
dataset: Sequence[_Dataset_T],
351351
max_threads: int = 8,
352352
*overflow_args: Overflow_In,

0 commit comments

Comments
 (0)