We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d741eb2 + ea59338 commit f3b9720Copy full SHA for f3b9720
numpy/typing/tests/data/pass/shape.py
@@ -8,16 +8,12 @@ class XYGrid(NamedTuple):
8
x_axis: int
9
y_axis: int
10
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
18
# Test variance of _ShapeType_co
19
def accepts_2d(a: np.ndarray[tuple[int, int], Any]) -> None:
20
return None
21
22
23
-accepts_2d(arr)
+accepts_2d(np.empty(XYGrid(2, 2)))
+accepts_2d(np.zeros(XYGrid(2, 2), dtype=int))
+accepts_2d(np.ones(XYGrid(2, 2), dtype=int))
+accepts_2d(np.full(XYGrid(2, 2), fill_value=5, dtype=int))
0 commit comments