@@ -630,7 +630,6 @@ _NumericArrayT = TypeVar("_NumericArrayT", bound=NDArray[number | timedelta64 |
630
630
_ShapeT = TypeVar ("_ShapeT" , bound = _nt .Shape )
631
631
_ShapeT_co = TypeVar ("_ShapeT_co" , bound = _nt .Shape , covariant = True )
632
632
_ShapeT_1nd = TypeVar ("_ShapeT_1nd" , bound = _nt .Shape1N )
633
- _1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], * tuple [L [1 ], ...]]) # TODO(jorenham): remove
634
633
635
634
_ScalarT = TypeVar ("_ScalarT" , bound = generic )
636
635
_SelfScalarT = TypeVar ("_SelfScalarT" , bound = generic )
@@ -1959,7 +1958,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
1959
1958
def __array__ (self , dtype : _DTypeT , / , * , copy : bool | None = None ) -> ndarray [_ShapeT_co , _DTypeT ]: ...
1960
1959
1961
1960
#
1962
- def __array_finalize__ (self , obj : NDArray [Any ] | Any , / ) -> None : ...
1961
+ def __array_finalize__ (self , obj : _nt . Array [Any ] | Any , / ) -> None : ...
1963
1962
def __array_ufunc__ (self , ufunc : ufunc , method : _UFuncMethod , / , * inputs : object , ** kwargs : object ) -> Any : ...
1964
1963
def __array_function__ (
1965
1964
self ,
@@ -2909,12 +2908,25 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2909
2908
@overload
2910
2909
def resize (self : ndarray [_ShapeT , Any ], new_shape : _ShapeT , / , * , refcheck : py_bool = True ) -> None : ...
2911
2910
@overload
2912
- def resize (self : _nt .Array1D [Any ], n0 : CanIndex , / , * , refcheck : py_bool = True ) -> None : ...
2911
+ def resize (self : _nt .Array [Any , _nt . Shape1 ], n0 : CanIndex , / , * , refcheck : py_bool = True ) -> None : ...
2913
2912
@overload
2914
- def resize (self : _nt .Array2D [Any ], n0 : CanIndex , n1 : CanIndex , / , * , refcheck : py_bool = True ) -> None : ...
2913
+ def resize (
2914
+ self : _nt .Array [Any , _nt .Shape2 ], n0 : CanIndex , n1 : CanIndex , / , * , refcheck : py_bool = True
2915
+ ) -> None : ...
2916
+ @overload
2917
+ def resize (
2918
+ self : _nt .Array [Any , _nt .Shape3 ], n0 : CanIndex , n1 : CanIndex , n2 : CanIndex , / , * , refcheck : py_bool = True
2919
+ ) -> None : ...
2915
2920
@overload
2916
2921
def resize (
2917
- self : _nt .Array3D [Any ], n0 : CanIndex , n1 : CanIndex , n2 : CanIndex , / , * , refcheck : py_bool = True
2922
+ self : _nt .Array [Any , _nt .Shape4 ],
2923
+ n0 : CanIndex ,
2924
+ n1 : CanIndex ,
2925
+ n2 : CanIndex ,
2926
+ n3 : CanIndex ,
2927
+ / ,
2928
+ * ,
2929
+ refcheck : py_bool = True ,
2918
2930
) -> None : ...
2919
2931
2920
2932
#
@@ -3271,7 +3283,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
3271
3283
3272
3284
#
3273
3285
@overload
3274
- def repeat (self , / , repeats : _nt .CoInteger_nd , axis : None = None ) -> ndarray [_nt .Shape1 , _DTypeT_co ]: ...
3286
+ def repeat (self , / , repeats : _nt .CoInteger_nd , axis : None = None ) -> ndarray [_nt .Rank1 , _DTypeT_co ]: ...
3275
3287
@overload
3276
3288
def repeat (
3277
3289
self : ndarray [_AnyShapeT , _DTypeT ], / , repeats : _nt .CoInteger_nd , axis : CanIndex
@@ -3719,15 +3731,6 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3719
3731
order : _OrderACF = "C" ,
3720
3732
copy : py_bool | None = None ,
3721
3733
) -> Self : ...
3722
- @overload # ((1, *(1, ...))@_ShapeType)
3723
- def reshape (
3724
- self ,
3725
- shape : _1NShapeT ,
3726
- / ,
3727
- * ,
3728
- order : _OrderACF = "C" ,
3729
- copy : py_bool | None = None ,
3730
- ) -> ndarray [_1NShapeT , dtype [Self ]]: ...
3731
3734
@overload # (Sequence[index, ...]) # not recommended
3732
3735
def reshape (
3733
3736
self ,
@@ -3767,18 +3770,6 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3767
3770
order : _OrderACF = "C" ,
3768
3771
copy : py_bool | None = None ,
3769
3772
) -> _nt .Array3D [Self ]: ...
3770
- @overload # _(index, index, index, index)
3771
- def reshape (
3772
- self ,
3773
- size1 : CanIndex ,
3774
- size2 : CanIndex ,
3775
- size3 : CanIndex ,
3776
- size4 : CanIndex ,
3777
- / ,
3778
- * ,
3779
- order : _OrderACF = "C" ,
3780
- copy : py_bool | None = None ,
3781
- ) -> _nt .Array4D [Self ]: ...
3782
3773
@overload # _(index, index, index, index, *index) # ndim >= 5
3783
3774
def reshape (
3784
3775
self ,
@@ -3790,7 +3781,7 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3790
3781
* sizes5_ : CanIndex ,
3791
3782
order : _OrderACF = "C" ,
3792
3783
copy : py_bool | None = None ,
3793
- ) -> _nt .Array [Self , _nt .Shape4N ]: ...
3784
+ ) -> _nt .Array [Self , _nt .Rank4N ]: ...
3794
3785
3795
3786
#
3796
3787
@overload
0 commit comments