Skip to content

Commit 673cd73

Browse files
committed
Fix some type hint aliases for numpy.array_api
Original NumPy Commit: 700ded88944ed876e7453159d8441c14516727d5
1 parent 3dd533b commit 673cd73

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

array_api_strict/_typing.py

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,18 @@
2929
Protocol,
3030
)
3131

32-
from ._array_object import Array, CPU_DEVICE
33-
from numpy import (
34-
dtype,
35-
int8,
36-
int16,
37-
int32,
38-
int64,
39-
uint8,
40-
uint16,
41-
uint32,
42-
uint64,
43-
float32,
44-
float64,
45-
)
32+
from ._array_object import Array, _cpu_device
33+
from ._dtypes import _DType
4634

4735
_T_co = TypeVar("_T_co", covariant=True)
4836

4937
class NestedSequence(Protocol[_T_co]):
5038
def __getitem__(self, key: int, /) -> _T_co | NestedSequence[_T_co]: ...
5139
def __len__(self, /) -> int: ...
5240

53-
Device = type(CPU_DEVICE)
41+
Device = _cpu_device
5442

55-
Dtype = dtype[Union[
56-
int8,
57-
int16,
58-
int32,
59-
int64,
60-
uint8,
61-
uint16,
62-
uint32,
63-
uint64,
64-
float32,
65-
float64,
66-
]]
43+
Dtype =_DType
6744

6845
if sys.version_info >= (3, 12):
6946
from collections.abc import Buffer as SupportsBufferProtocol

0 commit comments

Comments
 (0)