Skip to content

Commit f3b9720

Browse files
authored
Merge pull request numpy#28499 from guan404ming/remove-unnecessary-cast
TYP: remove unneseccary cast
2 parents d741eb2 + ea59338 commit f3b9720

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

numpy/typing/tests/data/pass/shape.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ class XYGrid(NamedTuple):
88
x_axis: int
99
y_axis: int
1010

11-
12-
# TODO: remove this cast after: https://github.com/numpy/numpy/pull/27171
13-
arr: np.ndarray[XYGrid, Any] = cast(
14-
np.ndarray[XYGrid, Any],
15-
np.empty(XYGrid(2, 2)),
16-
)
17-
1811
# Test variance of _ShapeType_co
1912
def accepts_2d(a: np.ndarray[tuple[int, int], Any]) -> None:
2013
return None
2114

2215

23-
accepts_2d(arr)
16+
accepts_2d(np.empty(XYGrid(2, 2)))
17+
accepts_2d(np.zeros(XYGrid(2, 2), dtype=int))
18+
accepts_2d(np.ones(XYGrid(2, 2), dtype=int))
19+
accepts_2d(np.full(XYGrid(2, 2), fill_value=5, dtype=int))

0 commit comments

Comments
 (0)