11import functools
2- from typing import Callable , Sequence , Tuple , TypeVar , Union
2+ from collections .abc import Sequence
3+ from typing import Callable , Tuple , TypeVar , Union
34
45import numpy as np
56
@@ -39,7 +40,7 @@ def inner(array: np.ndarray, *args, **kwargs) -> bool:
3940 return inner
4041
4142
42- def _base_all_type (array : np .ndarray , dtypes : Union [type , Tuple [type , ...]]) -> bool :
43+ def _base_all_type (array : np .ndarray , dtypes : Union [type , tuple [type , ...]]) -> bool :
4344 return all (isinstance (v , dtypes ) for v in array )
4445
4546
@@ -48,7 +49,7 @@ def _base_all_type(array: np.ndarray, dtypes: Union[type, Tuple[type, ...]]) ->
4849 # There are alternative implementations with forceobj=True which work in all cases
4950 # including the use of isinstance, but in those cases worst case performance can be substantially worse
5051 # than the default python implementation.
51- def all_type_numba (dtype : Union [Tuple , T ]):
52+ def all_type_numba (dtype : Union [tuple , T ]):
5253 @nb .jit (nopython = True )
5354 def inner (array : np .ndarray ) -> bool :
5455 for i in nb .prange (array .size ):
@@ -58,10 +59,10 @@ def inner(array: np.ndarray) -> bool:
5859
5960 return inner
6061
61- def all_type (array : np .ndarray , dtypes : Union [type , Tuple [type , ...]]) -> bool :
62+ def all_type (array : np .ndarray , dtypes : Union [type , tuple [type , ...]]) -> bool :
6263 return _base_all_type (array , dtypes )
6364
6465else :
6566
66- def all_type (array : np .ndarray , dtypes : Union [type , Tuple [type , ...]]) -> bool :
67+ def all_type (array : np .ndarray , dtypes : Union [type , tuple [type , ...]]) -> bool :
6768 return _base_all_type (array , dtypes )
0 commit comments