Skip to content

Commit bb443be

Browse files
authored
Merge pull request numpy#27211 from jorenham/typing/NDArray-shape-default
TYP: Stop using ``Any`` as shape-type default
2 parents 5f085a1 + 0e05de4 commit bb443be

18 files changed

+192
-177
lines changed

numpy/__init__.pyi

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,9 +1375,9 @@ class flatiter(Generic[_NdArraySubClass_co]):
13751375
@overload
13761376
def __array__(self: flatiter[ndarray[_FlatShapeType, Any]], dtype: _DType, /) -> ndarray[_FlatShapeType, _DType]: ...
13771377
@overload
1378-
def __array__(self: flatiter[ndarray[Any, _DType]], dtype: None = ..., /) -> ndarray[Any, _DType]: ...
1378+
def __array__(self: flatiter[ndarray[_Shape, _DType]], dtype: None = ..., /) -> ndarray[_Shape, _DType]: ...
13791379
@overload
1380-
def __array__(self, dtype: _DType, /) -> ndarray[Any, _DType]: ...
1380+
def __array__(self, dtype: _DType, /) -> ndarray[_Shape, _DType]: ...
13811381

13821382
_OrderKACF: TypeAlias = L[None, "K", "A", "C", "F"]
13831383
_OrderACF: TypeAlias = L[None, "A", "C", "F"]
@@ -1828,11 +1828,15 @@ _DType = TypeVar("_DType", bound=dtype[Any])
18281828
_DType_co = TypeVar("_DType_co", covariant=True, bound=dtype[Any])
18291829
_FlexDType = TypeVar("_FlexDType", bound=dtype[flexible])
18301830

1831-
_ShapeType_co = TypeVar("_ShapeType_co", covariant=True, bound=tuple[int, ...])
1832-
_ShapeType2 = TypeVar("_ShapeType2", bound=tuple[int, ...])
1833-
_Shape2DType_co = TypeVar("_Shape2DType_co", covariant=True, bound=tuple[int, int])
1831+
_Shape1D: TypeAlias = tuple[int]
1832+
_Shape2D: TypeAlias = tuple[int, int]
1833+
1834+
_ShapeType_co = TypeVar("_ShapeType_co", covariant=True, bound=_Shape)
1835+
_ShapeType2 = TypeVar("_ShapeType2", bound=_Shape)
1836+
_Shape2DType_co = TypeVar("_Shape2DType_co", covariant=True, bound=_Shape2D)
18341837
_NumberType = TypeVar("_NumberType", bound=number[Any])
18351838

1839+
18361840
if sys.version_info >= (3, 12):
18371841
from collections.abc import Buffer as _SupportsBuffer
18381842
else:
@@ -1958,7 +1962,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
19581962
NDArray[integer[Any]]
19591963
| NDArray[np.bool]
19601964
| tuple[NDArray[integer[Any]] | NDArray[np.bool], ...]
1961-
)) -> ndarray[Any, _DType_co]: ...
1965+
)) -> ndarray[_Shape, _DType_co]: ...
19621966
@overload
19631967
def __getitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...]) -> Any: ...
19641968
@overload
@@ -1969,7 +1973,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
19691973
| SupportsIndex
19701974
| _ArrayLikeInt_co
19711975
| tuple[None | slice | EllipsisType | _ArrayLikeInt_co | SupportsIndex, ...]
1972-
)) -> ndarray[Any, _DType_co]: ...
1976+
)) -> ndarray[_Shape, _DType_co]: ...
19731977
@overload
19741978
def __getitem__(self: NDArray[void], key: str) -> NDArray[Any]: ...
19751979
@overload
@@ -2015,13 +2019,13 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
20152019
def squeeze(
20162020
self,
20172021
axis: None | SupportsIndex | tuple[SupportsIndex, ...] = ...,
2018-
) -> ndarray[Any, _DType_co]: ...
2022+
) -> ndarray[_Shape, _DType_co]: ...
20192023

20202024
def swapaxes(
20212025
self,
20222026
axis1: SupportsIndex,
20232027
axis2: SupportsIndex,
2024-
) -> ndarray[Any, _DType_co]: ...
2028+
) -> ndarray[_Shape, _DType_co]: ...
20252029

20262030
@overload
20272031
def transpose(self, axes: None | _ShapeLike, /) -> Self: ...
@@ -2041,7 +2045,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
20412045
offset: SupportsIndex = ...,
20422046
axis1: SupportsIndex = ...,
20432047
axis2: SupportsIndex = ...,
2044-
) -> ndarray[Any, _DType_co]: ...
2048+
) -> ndarray[_Shape, _DType_co]: ...
20452049

20462050
# 1D + 1D returns a scalar;
20472051
# all other with at least 1 non-0D array return an ndarray.
@@ -2137,7 +2141,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
21372141
axis: None | SupportsIndex = ...,
21382142
out: None = ...,
21392143
mode: _ModeKind = ...,
2140-
) -> ndarray[Any, _DType_co]: ...
2144+
) -> ndarray[_Shape, _DType_co]: ...
21412145
@overload
21422146
def take(
21432147
self,
@@ -2151,19 +2155,19 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
21512155
self,
21522156
repeats: _ArrayLikeInt_co,
21532157
axis: None | SupportsIndex = ...,
2154-
) -> ndarray[Any, _DType_co]: ...
2158+
) -> ndarray[_Shape, _DType_co]: ...
21552159

21562160
# TODO: use `tuple[int]` as shape type once covariant (#26081)
21572161
def flatten(
21582162
self,
21592163
order: _OrderKACF = ...,
2160-
) -> ndarray[Any, _DType_co]: ...
2164+
) -> ndarray[_Shape, _DType_co]: ...
21612165

21622166
# TODO: use `tuple[int]` as shape type once covariant (#26081)
21632167
def ravel(
21642168
self,
21652169
order: _OrderKACF = ...,
2166-
) -> ndarray[Any, _DType_co]: ...
2170+
) -> ndarray[_Shape, _DType_co]: ...
21672171

21682172
@overload
21692173
def reshape(
@@ -2173,14 +2177,14 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType_co, _DType_co]):
21732177
*,
21742178
order: _OrderACF = ...,
21752179
copy: None | bool = ...,
2176-
) -> ndarray[Any, _DType_co]: ...
2180+
) -> ndarray[_Shape, _DType_co]: ...
21772181
@overload
21782182
def reshape(
21792183
self,
21802184
*shape: SupportsIndex,
21812185
order: _OrderACF = ...,
21822186
copy: None | bool = ...,
2183-
) -> ndarray[Any, _DType_co]: ...
2187+
) -> ndarray[_Shape, _DType_co]: ...
21842188

21852189
@overload
21862190
def astype(
@@ -3061,7 +3065,7 @@ class generic(_ArrayOrScalarCommon):
30613065
@overload
30623066
def __array__(self, dtype: None = ..., /) -> NDArray[Self]: ...
30633067
@overload
3064-
def __array__(self, dtype: _DType, /) -> ndarray[Any, _DType]: ...
3068+
def __array__(self, dtype: _DType, /) -> ndarray[_Shape, _DType]: ...
30653069
def __hash__(self) -> int: ...
30663070
@property
30673071
def base(self) -> None: ...
@@ -4216,7 +4220,7 @@ class poly1d:
42164220
@overload
42174221
def __array__(self, t: None = ..., copy: None | bool = ...) -> NDArray[Any]: ...
42184222
@overload
4219-
def __array__(self, t: _DType, copy: None | bool = ...) -> ndarray[Any, _DType]: ...
4223+
def __array__(self, t: _DType, copy: None | bool = ...) -> ndarray[_Shape, _DType]: ...
42204224

42214225
@overload
42224226
def __call__(self, val: _ScalarLike_co) -> Any: ...
@@ -4256,15 +4260,14 @@ class poly1d:
42564260
) -> poly1d: ...
42574261

42584262

4259-
42604263
class matrix(ndarray[_Shape2DType_co, _DType_co]):
42614264
__array_priority__: ClassVar[float]
42624265
def __new__(
42634266
subtype,
42644267
data: ArrayLike,
42654268
dtype: DTypeLike = ...,
42664269
copy: builtins.bool = ...,
4267-
) -> matrix[Any, Any]: ...
4270+
) -> matrix[_Shape2D, Any]: ...
42684271
def __array_finalize__(self, obj: object) -> None: ...
42694272

42704273
@overload
@@ -4289,122 +4292,122 @@ class matrix(ndarray[_Shape2DType_co, _DType_co]):
42894292
| tuple[None | slice | EllipsisType | _ArrayLikeInt_co | SupportsIndex, ...]
42904293
),
42914294
/,
4292-
) -> matrix[Any, _DType_co]: ...
4295+
) -> matrix[_Shape2D, _DType_co]: ...
42934296
@overload
4294-
def __getitem__(self: NDArray[void], key: str, /) -> matrix[Any, dtype[Any]]: ...
4297+
def __getitem__(self: NDArray[void], key: str, /) -> matrix[_Shape2D, dtype[Any]]: ...
42954298
@overload
42964299
def __getitem__(self: NDArray[void], key: list[str], /) -> matrix[_Shape2DType_co, dtype[void]]: ...
42974300

4298-
def __mul__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
4299-
def __rmul__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
4301+
def __mul__(self, other: ArrayLike, /) -> matrix[_Shape2D, Any]: ...
4302+
def __rmul__(self, other: ArrayLike, /) -> matrix[_Shape2D, Any]: ...
43004303
def __imul__(self, other: ArrayLike, /) -> matrix[_Shape2DType_co, _DType_co]: ...
4301-
def __pow__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
4304+
def __pow__(self, other: ArrayLike, /) -> matrix[_Shape2D, Any]: ...
43024305
def __ipow__(self, other: ArrayLike, /) -> matrix[_Shape2DType_co, _DType_co]: ...
43034306

43044307
@overload
43054308
def sum(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ...) -> Any: ...
43064309
@overload
4307-
def sum(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[Any, Any]: ...
4310+
def sum(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[_Shape2D, Any]: ...
43084311
@overload
43094312
def sum(self, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43104313

43114314
@overload
43124315
def mean(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ...) -> Any: ...
43134316
@overload
4314-
def mean(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[Any, Any]: ...
4317+
def mean(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[_Shape2D, Any]: ...
43154318
@overload
43164319
def mean(self, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43174320

43184321
@overload
43194322
def std(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> Any: ...
43204323
@overload
4321-
def std(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> matrix[Any, Any]: ...
4324+
def std(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> matrix[_Shape2D, Any]: ...
43224325
@overload
43234326
def std(self, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _NdArraySubClass = ..., ddof: float = ...) -> _NdArraySubClass: ...
43244327

43254328
@overload
43264329
def var(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> Any: ...
43274330
@overload
4328-
def var(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> matrix[Any, Any]: ...
4331+
def var(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ..., ddof: float = ...) -> matrix[_Shape2D, Any]: ...
43294332
@overload
43304333
def var(self, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _NdArraySubClass = ..., ddof: float = ...) -> _NdArraySubClass: ...
43314334

43324335
@overload
43334336
def prod(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ...) -> Any: ...
43344337
@overload
4335-
def prod(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[Any, Any]: ...
4338+
def prod(self, axis: _ShapeLike, dtype: DTypeLike = ..., out: None = ...) -> matrix[_Shape2D, Any]: ...
43364339
@overload
43374340
def prod(self, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43384341

43394342
@overload
43404343
def any(self, axis: None = ..., out: None = ...) -> np.bool: ...
43414344
@overload
4342-
def any(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, dtype[np.bool]]: ...
4345+
def any(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, dtype[np.bool]]: ...
43434346
@overload
43444347
def any(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43454348

43464349
@overload
43474350
def all(self, axis: None = ..., out: None = ...) -> np.bool: ...
43484351
@overload
4349-
def all(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, dtype[np.bool]]: ...
4352+
def all(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, dtype[np.bool]]: ...
43504353
@overload
43514354
def all(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43524355

43534356
@overload
43544357
def max(self: NDArray[_ScalarType], axis: None = ..., out: None = ...) -> _ScalarType: ...
43554358
@overload
4356-
def max(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, _DType_co]: ...
4359+
def max(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, _DType_co]: ...
43574360
@overload
43584361
def max(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43594362

43604363
@overload
43614364
def min(self: NDArray[_ScalarType], axis: None = ..., out: None = ...) -> _ScalarType: ...
43624365
@overload
4363-
def min(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, _DType_co]: ...
4366+
def min(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, _DType_co]: ...
43644367
@overload
43654368
def min(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43664369

43674370
@overload
43684371
def argmax(self: NDArray[_ScalarType], axis: None = ..., out: None = ...) -> intp: ...
43694372
@overload
4370-
def argmax(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, dtype[intp]]: ...
4373+
def argmax(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, dtype[intp]]: ...
43714374
@overload
43724375
def argmax(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43734376

43744377
@overload
43754378
def argmin(self: NDArray[_ScalarType], axis: None = ..., out: None = ...) -> intp: ...
43764379
@overload
4377-
def argmin(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, dtype[intp]]: ...
4380+
def argmin(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, dtype[intp]]: ...
43784381
@overload
43794382
def argmin(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43804383

43814384
@overload
43824385
def ptp(self: NDArray[_ScalarType], axis: None = ..., out: None = ...) -> _ScalarType: ...
43834386
@overload
4384-
def ptp(self, axis: _ShapeLike, out: None = ...) -> matrix[Any, _DType_co]: ...
4387+
def ptp(self, axis: _ShapeLike, out: None = ...) -> matrix[_Shape2D, _DType_co]: ...
43854388
@overload
43864389
def ptp(self, axis: None | _ShapeLike = ..., out: _NdArraySubClass = ...) -> _NdArraySubClass: ...
43874390

4388-
def squeeze(self, axis: None | _ShapeLike = ...) -> matrix[Any, _DType_co]: ...
4389-
def tolist(self: matrix[Any, dtype[_SupportsItem[_T]]]) -> list[list[_T]]: ... # type: ignore[typevar]
4390-
def ravel(self, order: _OrderKACF = ...) -> matrix[Any, _DType_co]: ...
4391-
def flatten(self, order: _OrderKACF = ...) -> matrix[Any, _DType_co]: ...
4391+
def squeeze(self, axis: None | _ShapeLike = ...) -> matrix[_Shape2D, _DType_co]: ...
4392+
def tolist(self: matrix[_Shape2D, dtype[_SupportsItem[_T]]]) -> list[list[_T]]: ... # type: ignore[typevar]
4393+
def ravel(self, order: _OrderKACF = ...) -> matrix[_Shape2D, _DType_co]: ...
4394+
def flatten(self, order: _OrderKACF = ...) -> matrix[_Shape2D, _DType_co]: ...
43924395

43934396
@property
4394-
def T(self) -> matrix[Any, _DType_co]: ...
4397+
def T(self) -> matrix[_Shape2D, _DType_co]: ...
43954398
@property
4396-
def I(self) -> matrix[Any, Any]: ...
4399+
def I(self) -> matrix[_Shape2D, Any]: ...
43974400
@property
43984401
def A(self) -> ndarray[_Shape2DType_co, _DType_co]: ...
43994402
@property
4400-
def A1(self) -> ndarray[Any, _DType_co]: ...
4403+
def A1(self) -> ndarray[_Shape, _DType_co]: ...
44014404
@property
4402-
def H(self) -> matrix[Any, _DType_co]: ...
4403-
def getT(self) -> matrix[Any, _DType_co]: ...
4404-
def getI(self) -> matrix[Any, Any]: ...
4405+
def H(self) -> matrix[_Shape2D, _DType_co]: ...
4406+
def getT(self) -> matrix[_Shape2D, _DType_co]: ...
4407+
def getI(self) -> matrix[_Shape2D, Any]: ...
44054408
def getA(self) -> ndarray[_Shape2DType_co, _DType_co]: ...
4406-
def getA1(self) -> ndarray[Any, _DType_co]: ...
4407-
def getH(self) -> matrix[Any, _DType_co]: ...
4409+
def getA1(self) -> ndarray[_Shape, _DType_co]: ...
4410+
def getH(self) -> matrix[_Shape2D, _DType_co]: ...
44084411

44094412
_CharType = TypeVar("_CharType", str_, bytes_)
44104413
_CharDType = TypeVar("_CharDType", dtype[str_], dtype[bytes_])

numpy/_core/defchararray.pyi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ from numpy import (
2323

2424
from numpy._typing import (
2525
NDArray,
26+
_Shape,
2627
_ShapeLike,
2728
_ArrayLikeStr_co as U_co,
2829
_ArrayLikeBytes_co as S_co,
@@ -33,7 +34,7 @@ from numpy._typing import (
3334
from numpy._core.multiarray import compare_chararrays as compare_chararrays
3435

3536
_SCT = TypeVar("_SCT", str_, bytes_)
36-
_CharArray = chararray[Any, dtype[_SCT]]
37+
_CharArray = chararray[_Shape, dtype[_SCT]]
3738

3839
class chararray(ndarray[_ShapeType_co, _CharDType]):
3940
@overload
@@ -46,7 +47,7 @@ class chararray(ndarray[_ShapeType_co, _CharDType]):
4647
offset: SupportsIndex = ...,
4748
strides: _ShapeLike = ...,
4849
order: _OrderKACF = ...,
49-
) -> chararray[Any, dtype[bytes_]]: ...
50+
) -> chararray[_Shape, dtype[bytes_]]: ...
5051
@overload
5152
def __new__(
5253
subtype,
@@ -57,12 +58,12 @@ class chararray(ndarray[_ShapeType_co, _CharDType]):
5758
offset: SupportsIndex = ...,
5859
strides: _ShapeLike = ...,
5960
order: _OrderKACF = ...,
60-
) -> chararray[Any, dtype[str_]]: ...
61+
) -> chararray[_Shape, dtype[str_]]: ...
6162

6263
def __array_finalize__(self, obj: object) -> None: ...
63-
def __mul__(self, other: i_co) -> chararray[Any, _CharDType]: ...
64-
def __rmul__(self, other: i_co) -> chararray[Any, _CharDType]: ...
65-
def __mod__(self, i: Any) -> chararray[Any, _CharDType]: ...
64+
def __mul__(self, other: i_co) -> chararray[_Shape, _CharDType]: ...
65+
def __rmul__(self, other: i_co) -> chararray[_Shape, _CharDType]: ...
66+
def __mod__(self, i: Any) -> chararray[_Shape, _CharDType]: ...
6667

6768
@overload
6869
def __eq__(
@@ -210,7 +211,7 @@ class chararray(ndarray[_ShapeType_co, _CharDType]):
210211
def expandtabs(
211212
self,
212213
tabsize: i_co = ...,
213-
) -> chararray[Any, _CharDType]: ...
214+
) -> chararray[_Shape, _CharDType]: ...
214215

215216
@overload
216217
def find(
@@ -435,7 +436,7 @@ class chararray(ndarray[_ShapeType_co, _CharDType]):
435436
deletechars: None | S_co = ...,
436437
) -> _CharArray[bytes_]: ...
437438

438-
def zfill(self, width: _ArrayLikeInt_co) -> chararray[Any, _CharDType]: ...
439+
def zfill(self, width: _ArrayLikeInt_co) -> chararray[_Shape, _CharDType]: ...
439440
def capitalize(self) -> chararray[_ShapeType_co, _CharDType]: ...
440441
def title(self) -> chararray[_ShapeType_co, _CharDType]: ...
441442
def swapcase(self) -> chararray[_ShapeType_co, _CharDType]: ...

numpy/_core/records.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ from numpy._typing import (
2626
ArrayLike,
2727
DTypeLike,
2828
NDArray,
29+
_Shape,
2930
_ShapeLike,
3031
_ArrayLikeInt_co,
3132
_ArrayLikeVoid_co,
@@ -102,7 +103,7 @@ class recarray(ndarray[_ShapeType_co, _DType_co]):
102103
| SupportsIndex
103104
| _ArrayLikeInt_co
104105
| tuple[None | slice | EllipsisType | _ArrayLikeInt_co | SupportsIndex, ...]
105-
)) -> recarray[Any, _DType_co]: ...
106+
)) -> recarray[_Shape, _DType_co]: ...
106107
@overload
107108
def __getitem__(self, indx: (
108109
None
@@ -111,7 +112,7 @@ class recarray(ndarray[_ShapeType_co, _DType_co]):
111112
| SupportsIndex
112113
| _ArrayLikeInt_co
113114
| tuple[None | slice | EllipsisType | _ArrayLikeInt_co | SupportsIndex, ...]
114-
)) -> ndarray[Any, _DType_co]: ...
115+
)) -> ndarray[_Shape, _DType_co]: ...
115116
@overload
116117
def __getitem__(self, indx: str) -> NDArray[Any]: ...
117118
@overload

0 commit comments

Comments
 (0)