File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
# mypy: disable-error-code="no-redef"
2
2
3
3
from types import ModuleType
4
- from typing import Any
4
+ from typing import Any , assert_type
5
5
6
6
import numpy .array_api as np # type: ignore[import-not-found, unused-ignore]
7
7
from numpy import dtype
@@ -53,5 +53,5 @@ x_f32: xpt.Array[dtype[Any]] = nparr_f32
53
53
x_i32 : xpt .Array [dtype [Any ]] = nparr_i32
54
54
55
55
# 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 ])
Original file line number Diff line number Diff line change 1
1
# mypy: disable-error-code="no-redef"
2
2
3
3
from types import ModuleType
4
- from typing import Any , TypeAlias
4
+ from typing import Any , TypeAlias , assert_type
5
5
6
6
import numpy as np
7
7
import numpy .typing as npt
@@ -58,6 +58,6 @@ x_i32: xpt.Array[np.dtype[I32]] = nparr_i32
58
58
x_b : xpt .Array [np .dtype [B ]] = nparr_b
59
59
60
60
# 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 ])
You can’t perform that action at this time.
0 commit comments