@@ -36,6 +36,9 @@ class ParallelProcessing: ...
3636 SupportsLength ,
3737 SupportsGetItem ,
3838 SupportsLengthGetItem ,
39+ LengthLike_T ,
40+ GetLike_T ,
41+ LengthandGetLike_T ,
3942)
4043from typing_extensions import Generic
4144from typing import (
@@ -369,15 +372,11 @@ class ParallelProcessing(Generic[_Target_P, _Target_T, _Dataset_T]):
369372 def __init__ (
370373 self ,
371374 function : DatasetFunction [_Dataset_T , _Target_P , _Target_T ],
372- dataset : SupportsLengthGetItem [ _Dataset_T ] ,
375+ dataset : LengthandGetLike_T ,
373376 max_threads : int = 8 ,
374377 * overflow_args : Overflow_In ,
375- _get_value : Optional [
376- Callable [[SupportsLengthGetItem [_Dataset_T ], int ], _Dataset_T ]
377- ] = None ,
378- _length : Optional [
379- Union [int , Callable [[SupportsLengthGetItem [_Dataset_T ]], int ]]
380- ] = None ,
378+ _get_value : Optional [Callable [[LengthandGetLike_T , int ], _Dataset_T ]] = None ,
379+ _length : Optional [Union [int , Callable [[Any ], int ]]] = None ,
381380 ** overflow_kwargs : Overflow_In ,
382381 ) -> None : ...
383382
@@ -386,11 +385,11 @@ def __init__(
386385 def __init__ (
387386 self ,
388387 function : DatasetFunction [_Dataset_T , _Target_P , _Target_T ],
389- dataset : SupportsLength ,
388+ dataset : LengthLike_T ,
390389 max_threads : int = 8 ,
391390 * overflow_args : Overflow_In ,
392- _get_value : Callable [[SupportsLength , int ], _Dataset_T ],
393- _length : Optional [Union [int , Callable [[SupportsLength ], int ]]] = None ,
391+ _get_value : Callable [[LengthLike_T , int ], _Dataset_T ],
392+ _length : Optional [Union [int , Callable [[Any ], int ]]] = None ,
394393 ** overflow_kwargs : Overflow_In ,
395394 ) -> None : ...
396395
@@ -399,13 +398,11 @@ def __init__(
399398 def __init__ (
400399 self ,
401400 function : DatasetFunction [_Dataset_T , _Target_P , _Target_T ],
402- dataset : SupportsGetItem [ _Dataset_T ] ,
401+ dataset : GetLike_T ,
403402 max_threads : int = 8 ,
404403 * overflow_args : Overflow_In ,
405- _get_value : Optional [
406- Callable [[SupportsGetItem [_Dataset_T ], int ], _Dataset_T ]
407- ] = None ,
408- _length : Union [int , Callable [[SupportsGetItem [_Dataset_T ]], int ]],
404+ _get_value : Optional [Callable [[GetLike_T , int ], _Dataset_T ]] = None ,
405+ _length : Union [int , Callable [[GetLike_T ], int ]],
409406 ** overflow_kwargs : Overflow_In ,
410407 ) -> None : ...
411408
@@ -435,18 +432,13 @@ def __init__(
435432 * overflow_args : Overflow_In ,
436433 _get_value : Optional [
437434 Union [
438- Callable [[SupportsLengthGetItem [ _Dataset_T ] , int ], _Dataset_T ],
439- Callable [[SupportsGetItem [ _Dataset_T ] , int ], _Dataset_T ],
440- Callable [[SupportsLength , int ], _Dataset_T ],
435+ Callable [[LengthLike_T , int ], _Dataset_T ],
436+ Callable [[GetLike_T , int ], _Dataset_T ],
437+ Callable [[LengthLike_T , int ], _Dataset_T ],
441438 Callable [[Any , int ], _Dataset_T ],
442439 ]
443440 ] = None ,
444- _length : Optional [
445- Union [
446- int ,
447- Callable [[Any ], int ],
448- ]
449- ] = None ,
441+ _length : Optional [Union [int , Callable [[Any ], int ]]] = None ,
450442 ** overflow_kwargs : Overflow_In ,
451443 ) -> None :
452444 """
0 commit comments