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 11# mypy: disable-error-code="no-redef"
22
33from types import ModuleType
4- from typing import Any
4+ from typing import Any , assert_type
55
66import numpy .array_api as np # type: ignore[import-not-found, unused-ignore]
77from numpy import dtype
@@ -53,5 +53,5 @@ x_f32: xpt.Array[dtype[Any]] = nparr_f32
5353x_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 ])
Original file line number Diff line number Diff line change 11# mypy: disable-error-code="no-redef"
22
33from types import ModuleType
4- from typing import Any , TypeAlias
4+ from typing import Any , TypeAlias , assert_type
55
66import numpy as np
77import numpy .typing as npt
@@ -58,6 +58,6 @@ x_i32: xpt.Array[np.dtype[I32]] = nparr_i32
5858x_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 ])
You can’t perform that action at this time.
0 commit comments