Skip to content

Commit 11b9e5f

Browse files
MarcoGorelliMaanasArora
authored andcommitted
TYP: Use _Array1D alias in numpy.ma.core.pyi (numpy#28847)
1 parent 5aafa1f commit 11b9e5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

numpy/ma/core.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ _DTypeT = TypeVar("_DTypeT", bound=dtype)
226226
_DTypeT_co = TypeVar("_DTypeT_co", bound=dtype, covariant=True)
227227
_ArrayT = TypeVar("_ArrayT", bound=ndarray[Any, Any])
228228
_ScalarT = TypeVar("_ScalarT", bound=generic)
229-
_ScalarT_co = TypeVar("_ScalarT_co", bound=generic)
229+
_ScalarT_co = TypeVar("_ScalarT_co", bound=generic, covariant=True)
230230
# A subset of `MaskedArray` that can be parametrized w.r.t. `np.generic`
231231
_MaskedArray: TypeAlias = MaskedArray[_Shape, dtype[_ScalarT]]
232+
_Array1D: TypeAlias = np.ndarray[tuple[int], np.dtype[_ScalarT]]
232233

233234
MaskType = bool_
234235
nomask: bool_[Literal[False]]
@@ -1166,9 +1167,9 @@ def sort(
11661167
stable: Literal[False] | None = False,
11671168
) -> NDArray[Any]: ...
11681169
@overload
1169-
def compressed(x: _ArrayLike[_ScalarT_co]) -> ndarray[tuple[int], dtype[_ScalarT_co]]: ...
1170+
def compressed(x: _ArrayLike[_ScalarT_co]) -> _Array1D[_ScalarT_co]: ...
11701171
@overload
1171-
def compressed(x: ArrayLike) -> ndarray[tuple[int], dtype]: ...
1172+
def compressed(x: ArrayLike) -> _Array1D[Any]: ...
11721173
def concatenate(arrays, axis=...): ...
11731174
def diag(v, k=...): ...
11741175
def left_shift(a, n): ...

0 commit comments

Comments
 (0)