@@ -627,10 +627,10 @@ _ArrayT = TypeVar("_ArrayT", bound=NDArray[Any])
627627_IntegralArrayT = TypeVar ("_IntegralArrayT" , bound = NDArray [_nt .co_integer | object_ ])
628628_NumericArrayT = TypeVar ("_NumericArrayT" , bound = NDArray [number | timedelta64 | object_ ])
629629
630- _ShapeT = TypeVar ("_ShapeT" , bound = tuple [ int , ...] )
631- _ShapeT_co = TypeVar ("_ShapeT_co" , bound = tuple [ int , ...] , covariant = True )
632- _ShapeT_1nd = TypeVar ("_ShapeT_1nd" , bound = tuple [ int , * tuple [ int , ...]] )
633- _1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], * tuple [L [1 ], ...]]) # (1,) | (1, 1) | (1, 1, 1) | ...
630+ _ShapeT = TypeVar ("_ShapeT" , bound = _nt . Shape )
631+ _ShapeT_co = TypeVar ("_ShapeT_co" , bound = _nt . Shape , covariant = True )
632+ _ShapeT_1nd = TypeVar ("_ShapeT_1nd" , bound = _nt . Shape1_ )
633+ _1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], * tuple [L [1 ], ...]]) # TODO(jorenham): remove
634634
635635_ScalarT = TypeVar ("_ScalarT" , bound = generic )
636636_SelfScalarT = TypeVar ("_SelfScalarT" , bound = generic )
@@ -1180,7 +1180,7 @@ class dtype(Generic[_ScalarT_co], metaclass=_DTypeMeta):
11801180 @property
11811181 def num (self ) -> _DTypeNum : ...
11821182 @property
1183- def shape (self ) -> tuple [ int , ...] : ...
1183+ def shape (self ) -> _nt . Shape : ...
11841184 @property
11851185 def ndim (self ) -> int : ...
11861186 @property
@@ -2891,15 +2891,15 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
28912891
28922892 #
28932893 @overload
2894- def tolist (self : _HasShapeAndItem [tuple [()] , _T ], / ) -> _T : ...
2894+ def tolist (self : _HasShapeAndItem [_nt . Shape0 , _T ], / ) -> _T : ...
28952895 @overload
2896- def tolist (self : _HasShapeAndItem [tuple [ int ] , _T ], / ) -> list [_T ]: ...
2896+ def tolist (self : _HasShapeAndItem [_nt . Shape1 , _T ], / ) -> list [_T ]: ...
28972897 @overload
2898- def tolist (self : _HasShapeAndItem [tuple [ int , int ] , _T ], / ) -> list [list [_T ]]: ...
2898+ def tolist (self : _HasShapeAndItem [_nt . Shape2 , _T ], / ) -> list [list [_T ]]: ...
28992899 @overload
2900- def tolist (self : _HasShapeAndItem [tuple [ int , int , int ] , _T ], / ) -> list [list [list [_T ]]]: ...
2900+ def tolist (self : _HasShapeAndItem [_nt . Shape3 , _T ], / ) -> list [list [list [_T ]]]: ...
29012901 @overload
2902- def tolist (self : _HasShapeAndItem [tuple [ int , int , int , int ] , _T ], / ) -> list [list [list [list [_T ]]]]: ...
2902+ def tolist (self : _HasShapeAndItem [_nt . Shape4 , _T ], / ) -> list [list [list [list [_T ]]]]: ...
29032903 @overload
29042904 def tolist (self : _HasShapeAndItem [Any , _T ], / ) -> Any : ...
29052905
0 commit comments