Skip to content

Commit 142624d

Browse files
revert: Remove Dataset type
1 parent 5292f2e commit 142624d

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/thread/_types.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,3 @@ def __getitem__(self, i: int) -> _Dataset_T: ...
5757
@runtime_checkable
5858
class SupportsLengthGetItem(SupportsGetItem[_Dataset_T], SupportsLength, Protocol):
5959
pass
60-
61-
62-
Dataset = Union[
63-
Sequence[_Dataset_T],
64-
SupportsLength,
65-
SupportsGetItem[_Dataset_T],
66-
SupportsLengthGetItem[_Dataset_T],
67-
]

src/thread/thread.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ParallelProcessing: ...
3131
_Target_P,
3232
_Target_T,
3333
DatasetFunction,
34-
Dataset,
3534
_Dataset_T,
3635
HookFunction,
3736
SupportsLength,
@@ -353,7 +352,11 @@ class ParallelProcessing(Generic[_Target_P, _Target_T, _Dataset_T]):
353352

354353
status: ThreadStatus
355354
function: TargetFunction
356-
dataset: Dataset[_Dataset_T]
355+
dataset: Union[
356+
SupportsLengthGetItem[_Dataset_T],
357+
SupportsGetItem[_Dataset_T],
358+
SupportsLength,
359+
]
357360
max_threads: int
358361

359362
overflow_args: Sequence[Overflow_In]
@@ -419,7 +422,11 @@ def __init__(
419422
def __init__(
420423
self,
421424
function: DatasetFunction[_Dataset_T, _Target_P, _Target_T],
422-
dataset: Dataset[_Dataset_T],
425+
dataset: Union[
426+
SupportsLengthGetItem[_Dataset_T],
427+
SupportsGetItem[_Dataset_T],
428+
SupportsLength,
429+
],
423430
max_threads: int = 8,
424431
*overflow_args: Overflow_In,
425432
_get_value: Optional[

0 commit comments

Comments
 (0)