@@ -27,7 +27,7 @@ from numpy import (
27
27
timedelta64 ,
28
28
object_ ,
29
29
generic ,
30
- _AnyShapeType ,
30
+ _AnyShapeT ,
31
31
_OrderKACF ,
32
32
_OrderACF ,
33
33
_ModeKind ,
@@ -109,14 +109,14 @@ __all__ = [
109
109
_SCT = TypeVar ("_SCT" , bound = generic )
110
110
_SCT_uifcO = TypeVar ("_SCT_uifcO" , bound = number [Any ] | object_ )
111
111
_ArrayT = TypeVar ("_ArrayT" , bound = np .ndarray [Any , Any ])
112
- _ShapeType = TypeVar ("_ShapeType " , bound = tuple [int , ...])
113
- _ShapeType_co = TypeVar ("_ShapeType_co " , bound = tuple [int , ...], covariant = True )
112
+ _ShapeT = TypeVar ("_ShapeT " , bound = tuple [int , ...])
113
+ _ShapeT_co = TypeVar ("_ShapeT_co " , bound = tuple [int , ...], covariant = True )
114
114
115
115
@type_check_only
116
- class _SupportsShape (Protocol [_ShapeType_co ]):
116
+ class _SupportsShape (Protocol [_ShapeT_co ]):
117
117
# NOTE: it matters that `self` is positional only
118
118
@property
119
- def shape (self , / ) -> _ShapeType_co : ...
119
+ def shape (self , / ) -> _ShapeT_co : ...
120
120
121
121
# a "sequence" that isn't a string, bytes, bytearray, or memoryview
122
122
_T = TypeVar ("_T" )
@@ -184,14 +184,14 @@ def reshape( # shape: index
184
184
copy : bool | None = None ,
185
185
) -> np .ndarray [tuple [int ], np .dtype [_SCT ]]: ...
186
186
@overload
187
- def reshape ( # shape: (int, ...) @ _AnyShapeType
187
+ def reshape ( # shape: (int, ...) @ _AnyShapeT
188
188
a : _ArrayLike [_SCT ],
189
189
/ ,
190
- shape : _AnyShapeType ,
190
+ shape : _AnyShapeT ,
191
191
order : _OrderACF = "C" ,
192
192
* ,
193
193
copy : bool | None = None ,
194
- ) -> np .ndarray [_AnyShapeType , np .dtype [_SCT ]]: ...
194
+ ) -> np .ndarray [_AnyShapeT , np .dtype [_SCT ]]: ...
195
195
@overload # shape: Sequence[index]
196
196
def reshape (
197
197
a : _ArrayLike [_SCT ],
@@ -211,14 +211,14 @@ def reshape(
211
211
copy : bool | None = None ,
212
212
) -> np .ndarray [tuple [int ], np .dtype [Any ]]: ...
213
213
@overload
214
- def reshape ( # shape: (int, ...) @ _AnyShapeType
214
+ def reshape ( # shape: (int, ...) @ _AnyShapeT
215
215
a : ArrayLike ,
216
216
/ ,
217
- shape : _AnyShapeType ,
217
+ shape : _AnyShapeT ,
218
218
order : _OrderACF = "C" ,
219
219
* ,
220
220
copy : bool | None = None ,
221
- ) -> np .ndarray [_AnyShapeType , np .dtype [Any ]]: ...
221
+ ) -> np .ndarray [_AnyShapeT , np .dtype [Any ]]: ...
222
222
@overload # shape: Sequence[index]
223
223
def reshape (
224
224
a : ArrayLike ,
@@ -460,13 +460,13 @@ def searchsorted(
460
460
@overload
461
461
def resize (a : _ArrayLike [_SCT ], new_shape : SupportsIndex | tuple [SupportsIndex ]) -> np .ndarray [tuple [int ], np .dtype [_SCT ]]: ...
462
462
@overload
463
- def resize (a : _ArrayLike [_SCT ], new_shape : _AnyShapeType ) -> np .ndarray [_AnyShapeType , np .dtype [_SCT ]]: ...
463
+ def resize (a : _ArrayLike [_SCT ], new_shape : _AnyShapeT ) -> np .ndarray [_AnyShapeT , np .dtype [_SCT ]]: ...
464
464
@overload
465
465
def resize (a : _ArrayLike [_SCT ], new_shape : _ShapeLike ) -> NDArray [_SCT ]: ...
466
466
@overload
467
467
def resize (a : ArrayLike , new_shape : SupportsIndex | tuple [SupportsIndex ]) -> np .ndarray [tuple [int ], np .dtype [Any ]]: ...
468
468
@overload
469
- def resize (a : ArrayLike , new_shape : _AnyShapeType ) -> np .ndarray [_AnyShapeType , np .dtype [Any ]]: ...
469
+ def resize (a : ArrayLike , new_shape : _AnyShapeT ) -> np .ndarray [_AnyShapeT , np .dtype [Any ]]: ...
470
470
@overload
471
471
def resize (a : ArrayLike , new_shape : _ShapeLike ) -> NDArray [Any ]: ...
472
472
@@ -558,7 +558,7 @@ def nonzero(a: _ArrayLike[Any]) -> tuple[NDArray[intp], ...]: ...
558
558
@overload
559
559
def shape (a : _SupportsShape [Never ]) -> tuple [int , ...]: ...
560
560
@overload
561
- def shape (a : _SupportsShape [_ShapeType ]) -> _ShapeType : ...
561
+ def shape (a : _SupportsShape [_ShapeT ]) -> _ShapeT : ...
562
562
@overload
563
563
def shape (a : _PyScalar ) -> tuple [()]: ...
564
564
# `collections.abc.Sequence` can't be used hesre, since `bytes` and `str` are
0 commit comments