GeezerVison is showing github.com — TYP,TST: Adapt the typing test suite to mypy >=1.4 changes · numpy/numpy@6f52ecb
File treeExpand file treeCollapse file tree Open diff view settings numpy/typing/tests/data/reveal
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/array_constructors.pyi +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -126,10 +126,10 @@ reveal_type(np.linspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]] | 126 | 126 | reveal_type(np.linspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] | 127 | 127 | reveal_type(np.linspace(0, 10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] | 128 | 128 | reveal_type(np.linspace(0, 10, dtype=int)) # E: ndarray[Any, dtype[Any]] | 129 | | -reveal_type(np.linspace(0, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], floating[Any]] | 130 | | -reveal_type(np.linspace(0j, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], complexfloating[Any, Any]] | 131 | | -reveal_type(np.linspace(0, 10, retstep=True, dtype=np.int64)) # E: Tuple[ndarray[Any, dtype[{int64}]], {int64}] | 132 | | -reveal_type(np.linspace(0j, 10, retstep=True, dtype=int)) # E: Tuple[ndarray[Any, dtype[Any]], Any] | | 129 | +reveal_type(np.linspace(0, 10, retstep=True)) # E: tuple[ndarray[Any, dtype[floating[Any]]], floating[Any]] | | 130 | +reveal_type(np.linspace(0j, 10, retstep=True)) # E: tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], complexfloating[Any, Any]] | | 131 | +reveal_type(np.linspace(0, 10, retstep=True, dtype=np.int64)) # E: tuple[ndarray[Any, dtype[{int64}]], {int64}] | | 132 | +reveal_type(np.linspace(0j, 10, retstep=True, dtype=int)) # E: tuple[ndarray[Any, dtype[Any]], Any] | 133 | 133 |
| 134 | 134 | reveal_type(np.logspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]] | 135 | 135 | reveal_type(np.logspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] | |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/arraysetops.pyi +15-15Lines changed: 15 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ reveal_type(np.ediff1d(AR_LIKE_f8, to_begin=[1, 1.5])) # E: ndarray[Any, dtype[ | 18 | 18 | reveal_type(np.intersect1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] | 19 | 19 | reveal_type(np.intersect1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]] | 20 | 20 | reveal_type(np.intersect1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] | 21 | | -reveal_type(np.intersect1d(AR_f8, AR_f8, return_indices=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 21 | +reveal_type(np.intersect1d(AR_f8, AR_f8, return_indices=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 22 | 22 |
| 23 | 23 | reveal_type(np.setxor1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] | 24 | 24 | reveal_type(np.setxor1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]] | @@ -44,17 +44,17 @@ reveal_type(np.setdiff1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] | 44 | 44 |
| 45 | 45 | reveal_type(np.unique(AR_f8)) # E: ndarray[Any, dtype[{float64}]] | 46 | 46 | reveal_type(np.unique(AR_LIKE_f8, axis=0)) # E: ndarray[Any, dtype[Any]] | 47 | | -reveal_type(np.unique(AR_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | 48 | | -reveal_type(np.unique(AR_LIKE_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | 49 | | -reveal_type(np.unique(AR_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | 50 | | -reveal_type(np.unique(AR_LIKE_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | 51 | | -reveal_type(np.unique(AR_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | 52 | | -reveal_type(np.unique(AR_LIKE_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | 53 | | -reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 54 | | -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 55 | | -reveal_type(np.unique(AR_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 56 | | -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 57 | | -reveal_type(np.unique(AR_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 58 | | -reveal_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 59 | | -reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | 60 | | -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 47 | +reveal_type(np.unique(AR_f8, return_index=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | | 48 | +reveal_type(np.unique(AR_LIKE_f8, return_index=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | | 49 | +reveal_type(np.unique(AR_f8, return_inverse=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | | 50 | +reveal_type(np.unique(AR_LIKE_f8, return_inverse=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | | 51 | +reveal_type(np.unique(AR_f8, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] | | 52 | +reveal_type(np.unique(AR_LIKE_f8, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] | | 53 | +reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 54 | +reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 55 | +reveal_type(np.unique(AR_f8, return_index=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 56 | +reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 57 | +reveal_type(np.unique(AR_f8, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 58 | +reveal_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 59 | +reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] | | 60 | +reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/dtype.pyi +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,7 +49,7 @@ reveal_type(np.dtype(("U", 10))) # E: dtype[void] | 49 | 49 |
| 50 | 50 | # Methods and attributes | 51 | 51 | reveal_type(dtype_U.base) # E: dtype[Any] | 52 | | -reveal_type(dtype_U.subdtype) # E: Union[None, Tuple[dtype[Any], builtins.tuple[builtins.int, ...]]] | | 52 | +reveal_type(dtype_U.subdtype) # E: Union[None, tuple[dtype[Any], builtins.tuple[builtins.int, ...]]] | 53 | 53 | reveal_type(dtype_U.newbyteorder()) # E: dtype[str_] | 54 | 54 | reveal_type(dtype_U.type) # E: Type[str_] | 55 | 55 | reveal_type(dtype_U.name) # E: str | |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/einsumfunc.pyi +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,13 +26,13 @@ reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsaf | 26 | 26 | reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16")) # E: Any | 27 | 27 | reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe")) # E: Any | 28 | 28 |
| 29 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: Tuple[builtins.list[Any], builtins.str] | 30 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: Tuple[builtins.list[Any], builtins.str] | 31 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] | 32 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: Tuple[builtins.list[Any], builtins.str] | 33 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str] | 34 | | -reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] | 35 | | -reveal_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str] | | 29 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: tuple[builtins.list[Any], builtins.str] | | 30 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: tuple[builtins.list[Any], builtins.str] | | 31 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str] | | 32 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: tuple[builtins.list[Any], builtins.str] | | 33 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: tuple[builtins.list[Any], builtins.str] | | 34 | +reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str] | | 35 | +reveal_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: tuple[builtins.list[Any], builtins.str] | 36 | 36 |
| 37 | 37 | reveal_type(np.einsum([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Any | 38 | | -reveal_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] | | 38 | +reveal_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str] |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/histograms.pyi +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,12 +8,12 @@ reveal_type(np.histogram_bin_edges(AR_i8, bins="auto")) # E: ndarray[Any, dtype | 8 | 8 | reveal_type(np.histogram_bin_edges(AR_i8, bins="rice", range=(0, 3))) # E: ndarray[Any, dtype[Any]] | 9 | 9 | reveal_type(np.histogram_bin_edges(AR_i8, bins="scott", weights=AR_f8)) # E: ndarray[Any, dtype[Any]] | 10 | 10 |
| 11 | | -reveal_type(np.histogram(AR_i8, bins="auto")) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | 12 | | -reveal_type(np.histogram(AR_i8, bins="rice", range=(0, 3))) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | 13 | | -reveal_type(np.histogram(AR_i8, bins="scott", weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | 14 | | -reveal_type(np.histogram(AR_f8, bins=1, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | | 11 | +reveal_type(np.histogram(AR_i8, bins="auto")) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | | 12 | +reveal_type(np.histogram(AR_i8, bins="rice", range=(0, 3))) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | | 13 | +reveal_type(np.histogram(AR_i8, bins="scott", weights=AR_f8)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | | 14 | +reveal_type(np.histogram(AR_f8, bins=1, density=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | 15 | 15 |
| 16 | | -reveal_type(np.histogramdd(AR_i8, bins=[1])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | 17 | | -reveal_type(np.histogramdd(AR_i8, range=[(0, 3)])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | 18 | | -reveal_type(np.histogramdd(AR_i8, weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | 19 | | -reveal_type(np.histogramdd(AR_f8, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | | 16 | +reveal_type(np.histogramdd(AR_i8, bins=[1])) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | | 17 | +reveal_type(np.histogramdd(AR_i8, range=[(0, 3)])) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | | 18 | +reveal_type(np.histogramdd(AR_i8, weights=AR_f8)) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] | | 19 | +reveal_type(np.histogramdd(AR_f8, density=True)) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/index_tricks.pyi +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,9 +16,9 @@ reveal_type(np.ndenumerate(AR_i8).iter) # E: flatiter[ndarray[Any, dtype[{int64 | 16 | 16 | reveal_type(np.ndenumerate(AR_LIKE_f).iter) # E: flatiter[ndarray[Any, dtype[{double}]]] | 17 | 17 | reveal_type(np.ndenumerate(AR_LIKE_U).iter) # E: flatiter[ndarray[Any, dtype[str_]]] | 18 | 18 |
| 19 | | -reveal_type(next(np.ndenumerate(AR_i8))) # E: Tuple[builtins.tuple[builtins.int, ...], {int64}] | 20 | | -reveal_type(next(np.ndenumerate(AR_LIKE_f))) # E: Tuple[builtins.tuple[builtins.int, ...], {double}] | 21 | | -reveal_type(next(np.ndenumerate(AR_LIKE_U))) # E: Tuple[builtins.tuple[builtins.int, ...], str_] | | 19 | +reveal_type(next(np.ndenumerate(AR_i8))) # E: tuple[builtins.tuple[builtins.int, ...], {int64}] | | 20 | +reveal_type(next(np.ndenumerate(AR_LIKE_f))) # E: tuple[builtins.tuple[builtins.int, ...], {double}] | | 21 | +reveal_type(next(np.ndenumerate(AR_LIKE_U))) # E: tuple[builtins.tuple[builtins.int, ...], str_] | 22 | 22 |
| 23 | 23 | reveal_type(iter(np.ndenumerate(AR_i8))) # E: ndenumerate[{int64}] | 24 | 24 | reveal_type(iter(np.ndenumerate(AR_LIKE_f))) # E: ndenumerate[{double}] | @@ -46,13 +46,13 @@ reveal_type(np.mgrid[1:1:2, None:10]) # E: ndarray[Any, dtype[Any]] | 46 | 46 | reveal_type(np.ogrid[1:1:2]) # E: list[ndarray[Any, dtype[Any]]] | 47 | 47 | reveal_type(np.ogrid[1:1:2, None:10]) # E: list[ndarray[Any, dtype[Any]]] | 48 | 48 |
| 49 | | -reveal_type(np.index_exp[0:1]) # E: Tuple[builtins.slice] | 50 | | -reveal_type(np.index_exp[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice] | 51 | | -reveal_type(np.index_exp[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] | | 49 | +reveal_type(np.index_exp[0:1]) # E: tuple[builtins.slice] | | 50 | +reveal_type(np.index_exp[0:1, None:3]) # E: tuple[builtins.slice, builtins.slice] | | 51 | +reveal_type(np.index_exp[0, 0:1, ..., [0, 1, 3]]) # E: tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] | 52 | 52 |
| 53 | 53 | reveal_type(np.s_[0:1]) # E: builtins.slice | 54 | | -reveal_type(np.s_[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice] | 55 | | -reveal_type(np.s_[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] | | 54 | +reveal_type(np.s_[0:1, None:3]) # E: tuple[builtins.slice, builtins.slice] | | 55 | +reveal_type(np.s_[0, 0:1, ..., [0, 1, 3]]) # E: tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] | 56 | 56 |
| 57 | 57 | reveal_type(np.ix_(AR_LIKE_b)) # E: tuple[ndarray[Any, dtype[bool_]], ...] | 58 | 58 | reveal_type(np.ix_(AR_LIKE_i, AR_LIKE_f)) # E: tuple[ndarray[Any, dtype[{double}]], ...] | |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/lib_function_base.pyi +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,11 +46,11 @@ reveal_type(np.iterable([1])) # E: bool | 46 | 46 | reveal_type(np.average(AR_f8)) # E: floating[Any] | 47 | 47 | reveal_type(np.average(AR_f8, weights=AR_c16)) # E: complexfloating[Any, Any] | 48 | 48 | reveal_type(np.average(AR_O)) # E: Any | 49 | | -reveal_type(np.average(AR_f8, returned=True)) # E: Tuple[floating[Any], floating[Any]] | 50 | | -reveal_type(np.average(AR_f8, weights=AR_c16, returned=True)) # E: Tuple[complexfloating[Any, Any], complexfloating[Any, Any]] | 51 | | -reveal_type(np.average(AR_O, returned=True)) # E: Tuple[Any, Any] | | 49 | +reveal_type(np.average(AR_f8, returned=True)) # E: tuple[floating[Any], floating[Any]] | | 50 | +reveal_type(np.average(AR_f8, weights=AR_c16, returned=True)) # E: tuple[complexfloating[Any, Any], complexfloating[Any, Any]] | | 51 | +reveal_type(np.average(AR_O, returned=True)) # E: tuple[Any, Any] | 52 | 52 | reveal_type(np.average(AR_f8, axis=0)) # E: Any | 53 | | -reveal_type(np.average(AR_f8, axis=0, returned=True)) # E: Tuple[Any, Any] | | 53 | +reveal_type(np.average(AR_f8, axis=0, returned=True)) # E: tuple[Any, Any] | 54 | 54 |
| 55 | 55 | reveal_type(np.asarray_chkfinite(AR_f8)) # E: ndarray[Any, dtype[{float64}]] | 56 | 56 | reveal_type(np.asarray_chkfinite(AR_LIKE_f8)) # E: ndarray[Any, dtype[Any]] | |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/lib_polynomial.pyi +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,11 +61,11 @@ reveal_type(np.polyder(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, An | 61 | 61 | reveal_type(np.polyder(AR_O, m=2)) # E: ndarray[Any, dtype[object_]] | 62 | 62 |
| 63 | 63 | reveal_type(np.polyfit(AR_f8, AR_f8, 2)) # E: ndarray[Any, dtype[{float64}]] | 64 | | -reveal_type(np.polyfit(AR_f8, AR_i8, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | 65 | | -reveal_type(np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled")) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | | 64 | +reveal_type(np.polyfit(AR_f8, AR_i8, 1, full=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | | 65 | +reveal_type(np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled")) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | 66 | 66 | reveal_type(np.polyfit(AR_c16, AR_f8, 2)) # E: ndarray[Any, dtype[{complex128}]] | 67 | | -reveal_type(np.polyfit(AR_f8, AR_c16, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | 68 | | -reveal_type(np.polyfit(AR_u4, AR_c16, 1.0, cov=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{complex128}]]] | | 67 | +reveal_type(np.polyfit(AR_f8, AR_c16, 1, full=True)) # E: tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] | | 68 | +reveal_type(np.polyfit(AR_u4, AR_c16, 1.0, cov=True)) # E: tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{complex128}]]] | 69 | 69 |
| 70 | 70 | reveal_type(np.polyval(AR_b, AR_b)) # E: ndarray[Any, dtype[{int64}]] | 71 | 71 | reveal_type(np.polyval(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] | @@ -103,9 +103,9 @@ reveal_type(np.polymul(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] | 103 | 103 |
| 104 | 104 | reveal_type(np.polydiv(poly_obj, AR_i8)) # E: poly1d | 105 | 105 | reveal_type(np.polydiv(AR_f8, poly_obj)) # E: poly1d | 106 | | -reveal_type(np.polydiv(AR_b, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | 107 | | -reveal_type(np.polydiv(AR_u4, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | 108 | | -reveal_type(np.polydiv(AR_i8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | 109 | | -reveal_type(np.polydiv(AR_f8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | 110 | | -reveal_type(np.polydiv(AR_i8, AR_c16)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]] | 111 | | -reveal_type(np.polydiv(AR_O, AR_O)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | | 106 | +reveal_type(np.polydiv(AR_b, AR_b)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | | 107 | +reveal_type(np.polydiv(AR_u4, AR_b)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | | 108 | +reveal_type(np.polydiv(AR_i8, AR_i8)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | | 109 | +reveal_type(np.polydiv(AR_f8, AR_i8)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] | | 110 | +reveal_type(np.polydiv(AR_i8, AR_c16)) # E: tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]] | | 111 | +reveal_type(np.polydiv(AR_O, AR_O)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] |
Collapse file Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/lib_utils.pyi +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,8 +9,8 @@ FILE: StringIO | 9 | 9 |
| 10 | 10 | def func(a: int) -> bool: ... | 11 | 11 |
| 12 | | -reveal_type(np.byte_bounds(AR)) # E: Tuple[builtins.int, builtins.int] | 13 | | -reveal_type(np.byte_bounds(np.float64())) # E: Tuple[builtins.int, builtins.int] | | 12 | +reveal_type(np.byte_bounds(AR)) # E: tuple[builtins.int, builtins.int] | | 13 | +reveal_type(np.byte_bounds(np.float64())) # E: tuple[builtins.int, builtins.int] | 14 | 14 |
| 15 | 15 | reveal_type(np.info(1, output=FILE)) # E: None | 16 | 16 |
| |
|