diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/typing/tests/data/pass/array_constructors.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/typing/tests/data/pass/array_constructors.py b/numpy/typing/tests/data/pass/array_constructors.py index 722fa4b7e..13159f6bb 100644 --- a/numpy/typing/tests/data/pass/array_constructors.py +++ b/numpy/typing/tests/data/pass/array_constructors.py @@ -1,11 +1,19 @@ from typing import List, Any import numpy as np + class Index: def __index__(self) -> int: return 0 -class SubClass(np.ndarray): ... + +class SubClass(np.ndarray): + pass + + +def func(i: int, j: int, **kwargs: Any) -> SubClass: + return B + i8 = np.int64(1) @@ -14,9 +22,6 @@ B = A.view(SubClass).copy() B_stack = np.array([[1], [1]]).view(SubClass) C = [1] -def func(i: int, j: int, **kwargs: Any) -> SubClass: - return B - np.ndarray(Index()) np.ndarray([Index()]) |
