@@ -211,14 +211,19 @@ from typing import (
211211 Final ,
212212 Generic ,
213213 Literal as L ,
214+ LiteralString ,
215+ Never ,
214216 NoReturn ,
217+ Protocol ,
218+ Self ,
215219 SupportsComplex ,
216220 SupportsFloat ,
217221 SupportsInt ,
218222 SupportsIndex ,
219223 TypeAlias ,
220224 TypedDict ,
221225 final ,
226+ overload ,
222227 type_check_only ,
223228)
224229
@@ -227,7 +232,7 @@ from typing import (
227232# library include `typing_extensions` stubs:
228233# https://github.com/python/typeshed/blob/main/stdlib/typing_extensions.pyi
229234from _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
231236
232237from numpy import (
233238 char ,
@@ -813,7 +818,7 @@ _ShapeT = TypeVar("_ShapeT", bound=_Shape)
813818_ShapeT_co = TypeVar ("_ShapeT_co" , bound = _Shape , covariant = True )
814819_1DShapeT = TypeVar ("_1DShapeT" , bound = _1D )
815820_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) | ...
817822
818823_ScalarT = TypeVar ("_ScalarT" , bound = generic )
819824_ScalarT_co = TypeVar ("_ScalarT_co" , bound = generic , default = Any , covariant = True )
@@ -2543,7 +2548,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
25432548 @overload # == 1-d
25442549 def __iter__ (self : ndarray [tuple [int ], dtype [_ScalarT ]], / ) -> Iterator [_ScalarT ]: ...
25452550 @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 ]]: ...
25472552 @overload # ?-d
25482553 def __iter__ (self , / ) -> Iterator [Any ]: ...
25492554
@@ -3727,7 +3732,7 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
37273732 * sizes6_ : SupportsIndex ,
37283733 order : _OrderACF = "C" ,
37293734 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 ]]: ...
37313736
37323737 def squeeze (self , axis : None | L [0 ] | tuple [()] = ...) -> Self : ...
37333738 def transpose (self , axes : None | tuple [()] = ..., / ) -> Self : ...
0 commit comments