Skip to content

Commit b112a42

Browse files
committed
💄rearrange protocols in Array
Signed-off-by: nstarman <[email protected]>
1 parent 4de00ae commit b112a42

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎tests/integration/test_numpy1p0.pyi‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# mypy: disable-error-code="no-redef"
22

33
from types import ModuleType
4-
from typing import Any
4+
from typing import Any, assert_type
55

66
import numpy.array_api as np # type: ignore[import-not-found, unused-ignore]
77
from numpy import dtype
@@ -53,5 +53,5 @@ x_f32: xpt.Array[dtype[Any]] = nparr_f32
5353
x_i32: xpt.Array[dtype[Any]] = nparr_i32
5454

5555
# Check Attribute `.dtype`
56-
_: dtype[Any] = x_f32.dtype
57-
_: dtype[Any] = x_i32.dtype
56+
assert_type(x_f32.dtype, dtype[Any])
57+
assert_type(x_i32.dtype, dtype[Any])

‎tests/integration/test_numpy2p0.pyi‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# mypy: disable-error-code="no-redef"
22

33
from types import ModuleType
4-
from typing import Any, TypeAlias
4+
from typing import Any, TypeAlias, assert_type
55

66
import numpy as np
77
import numpy.typing as npt
@@ -58,6 +58,6 @@ x_i32: xpt.Array[np.dtype[I32]] = nparr_i32
5858
x_b: xpt.Array[np.dtype[B]] = nparr_b
5959

6060
# Check Attribute `.dtype`
61-
_: np.dtype[F32] = x_f32.dtype
62-
_: np.dtype[I32] = x_i32.dtype
63-
_: np.dtype[B] = x_b.dtype
61+
assert_type(x_f32.dtype, np.dtype[F32])
62+
assert_type(x_i32.dtype, np.dtype[I32])
63+
assert_type(x_b.dtype, np.dtype[B])

0 commit comments

Comments
 (0)