@@ -211,14 +211,19 @@ from typing import (
211
211
Final ,
212
212
Generic ,
213
213
Literal as L ,
214
+ LiteralString ,
215
+ Never ,
214
216
NoReturn ,
217
+ Protocol ,
218
+ Self ,
215
219
SupportsComplex ,
216
220
SupportsFloat ,
217
221
SupportsInt ,
218
222
SupportsIndex ,
219
223
TypeAlias ,
220
224
TypedDict ,
221
225
final ,
226
+ overload ,
222
227
type_check_only ,
223
228
)
224
229
@@ -227,7 +232,7 @@ from typing import (
227
232
# library include `typing_extensions` stubs:
228
233
# https://github.com/python/typeshed/blob/main/stdlib/typing_extensions.pyi
229
234
from _typeshed import StrOrBytesPath , SupportsFlush , SupportsLenAndGetItem , SupportsWrite
230
- from typing_extensions import CapsuleType , LiteralString , Never , Protocol , Self , TypeVar , Unpack , overload
235
+ from typing_extensions import CapsuleType , TypeVar
231
236
232
237
from numpy import (
233
238
char ,
@@ -813,7 +818,7 @@ _ShapeT = TypeVar("_ShapeT", bound=_Shape)
813
818
_ShapeT_co = TypeVar ("_ShapeT_co" , bound = _Shape , covariant = True )
814
819
_1DShapeT = TypeVar ("_1DShapeT" , bound = _1D )
815
820
_2DShapeT_co = TypeVar ("_2DShapeT_co" , bound = _2D , covariant = True )
816
- _1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], Unpack [ tuple [L [1 ], ...] ]]) # (1,) | (1, 1) | (1, 1, 1) | ...
821
+ _1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], * tuple [L [1 ], ...]]) # (1,) | (1, 1) | (1, 1, 1) | ...
817
822
818
823
_ScalarT = TypeVar ("_ScalarT" , bound = generic )
819
824
_ScalarT_co = TypeVar ("_ScalarT_co" , bound = generic , default = Any , covariant = True )
@@ -2543,7 +2548,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2543
2548
@overload # == 1-d
2544
2549
def __iter__ (self : ndarray [tuple [int ], dtype [_ScalarT ]], / ) -> Iterator [_ScalarT ]: ...
2545
2550
@overload # >= 2-d
2546
- def __iter__ (self : ndarray [tuple [int , int , Unpack [ tuple [int , ...] ]], dtype [_ScalarT ]], / ) -> Iterator [NDArray [_ScalarT ]]: ...
2551
+ def __iter__ (self : ndarray [tuple [int , int , * tuple [int , ...]], dtype [_ScalarT ]], / ) -> Iterator [NDArray [_ScalarT ]]: ...
2547
2552
@overload # ?-d
2548
2553
def __iter__ (self , / ) -> Iterator [Any ]: ...
2549
2554
@@ -3727,7 +3732,7 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3727
3732
* sizes6_ : SupportsIndex ,
3728
3733
order : _OrderACF = "C" ,
3729
3734
copy : builtins .bool | None = None ,
3730
- ) -> ndarray [tuple [L [1 ], L [1 ], L [1 ], L [1 ], L [1 ], Unpack [ tuple [L [1 ], ...] ]], dtype [Self ]]: ...
3735
+ ) -> ndarray [tuple [L [1 ], L [1 ], L [1 ], L [1 ], L [1 ], * tuple [L [1 ], ...]], dtype [Self ]]: ...
3731
3736
3732
3737
def squeeze (self , axis : None | L [0 ] | tuple [()] = ...) -> Self : ...
3733
3738
def transpose (self , axes : None | tuple [()] = ..., / ) -> Self : ...
0 commit comments