@@ -815,8 +815,8 @@ _1DShapeT = TypeVar("_1DShapeT", bound=_1D)
815
815
_2DShapeT_co = TypeVar ("_2DShapeT_co" , bound = _2D , covariant = True )
816
816
_1NShapeT = TypeVar ("_1NShapeT" , bound = tuple [L [1 ], Unpack [tuple [L [1 ], ...]]]) # (1,) | (1, 1) | (1, 1, 1) | ...
817
817
818
- _SCT = TypeVar ("_SCT " , bound = generic )
819
- _SCT_co = TypeVar ("_SCT_co " , bound = generic , default = Any , covariant = True )
818
+ _ScalarT = TypeVar ("_ScalarT " , bound = generic )
819
+ _ScalarT_co = TypeVar ("_ScalarT_co " , bound = generic , default = Any , covariant = True )
820
820
_NumberT = TypeVar ("_NumberT" , bound = number [Any ])
821
821
_RealNumberT = TypeVar ("_RealNumberT" , bound = floating | integer )
822
822
_FloatingT_co = TypeVar ("_FloatingT_co" , bound = floating [Any ], default = floating [Any ], covariant = True )
@@ -893,7 +893,7 @@ _BuiltinObjectLike: TypeAlias = (
893
893
) # fmt: skip
894
894
895
895
# Introduce an alias for `dtype` to avoid naming conflicts.
896
- _dtype : TypeAlias = dtype [_SCT ]
896
+ _dtype : TypeAlias = dtype [_ScalarT ]
897
897
898
898
_ByteOrderChar : TypeAlias = L ["<" , ">" , "=" , "|" ]
899
899
# can be anything, is case-insensitive, and only the first character matters
@@ -1186,7 +1186,7 @@ class _DTypeMeta(type):
1186
1186
def _legacy (cls , / ) -> bool : ...
1187
1187
1188
1188
@final
1189
- class dtype (Generic [_SCT_co ], metaclass = _DTypeMeta ):
1189
+ class dtype (Generic [_ScalarT_co ], metaclass = _DTypeMeta ):
1190
1190
names : None | tuple [builtins .str , ...]
1191
1191
def __hash__ (self ) -> int : ...
1192
1192
@@ -1201,15 +1201,15 @@ class dtype(Generic[_SCT_co], metaclass=_DTypeMeta):
1201
1201
) -> dtype [float64 ]: ...
1202
1202
1203
1203
# Overload for `dtype` instances, scalar types, and instances that have a
1204
- # `dtype: dtype[_SCT ]` attribute
1204
+ # `dtype: dtype[_ScalarT ]` attribute
1205
1205
@overload
1206
1206
def __new__ (
1207
1207
cls ,
1208
- dtype : _DTypeLike [_SCT ],
1208
+ dtype : _DTypeLike [_ScalarT ],
1209
1209
align : builtins .bool = ...,
1210
1210
copy : builtins .bool = ...,
1211
1211
metadata : dict [builtins .str , Any ] = ...,
1212
- ) -> dtype [_SCT ]: ...
1212
+ ) -> dtype [_ScalarT ]: ...
1213
1213
1214
1214
# Builtin types
1215
1215
#
@@ -1607,7 +1607,7 @@ class dtype(Generic[_SCT_co], metaclass=_DTypeMeta):
1607
1607
@property
1608
1608
def str (self ) -> LiteralString : ...
1609
1609
@property
1610
- def type (self ) -> type [_SCT_co ]: ...
1610
+ def type (self ) -> type [_ScalarT_co ]: ...
1611
1611
1612
1612
@final
1613
1613
class flatiter (Generic [_ArrayT_co ]):
@@ -1620,13 +1620,13 @@ class flatiter(Generic[_ArrayT_co]):
1620
1620
def index (self ) -> int : ...
1621
1621
def copy (self ) -> _ArrayT_co : ...
1622
1622
def __iter__ (self ) -> Self : ...
1623
- def __next__ (self : flatiter [NDArray [_SCT ]]) -> _SCT : ...
1623
+ def __next__ (self : flatiter [NDArray [_ScalarT ]]) -> _ScalarT : ...
1624
1624
def __len__ (self ) -> int : ...
1625
1625
@overload
1626
1626
def __getitem__ (
1627
- self : flatiter [NDArray [_SCT ]],
1627
+ self : flatiter [NDArray [_ScalarT ]],
1628
1628
key : int | integer [Any ] | tuple [int | integer [Any ]],
1629
- ) -> _SCT : ...
1629
+ ) -> _ScalarT : ...
1630
1630
@overload
1631
1631
def __getitem__ (
1632
1632
self ,
@@ -2041,11 +2041,11 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2041
2041
@property
2042
2042
def size (self ) -> int : ...
2043
2043
@property
2044
- def real (self : _HasDTypeWithRealAndImag [_SCT , object ], / ) -> ndarray [_ShapeT_co , dtype [_SCT ]]: ...
2044
+ def real (self : _HasDTypeWithRealAndImag [_ScalarT , object ], / ) -> ndarray [_ShapeT_co , dtype [_ScalarT ]]: ...
2045
2045
@real .setter
2046
2046
def real (self , value : ArrayLike , / ) -> None : ...
2047
2047
@property
2048
- def imag (self : _HasDTypeWithRealAndImag [object , _SCT ], / ) -> ndarray [_ShapeT_co , dtype [_SCT ]]: ...
2048
+ def imag (self : _HasDTypeWithRealAndImag [object , _ScalarT ], / ) -> ndarray [_ShapeT_co , dtype [_ScalarT ]]: ...
2049
2049
@imag .setter
2050
2050
def imag (self , value : ArrayLike , / ) -> None : ...
2051
2051
@@ -2377,12 +2377,12 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2377
2377
2378
2378
@overload
2379
2379
def take ( # type: ignore[misc]
2380
- self : NDArray [_SCT ],
2380
+ self : NDArray [_ScalarT ],
2381
2381
indices : _IntLike_co ,
2382
2382
axis : None | SupportsIndex = ...,
2383
2383
out : None = ...,
2384
2384
mode : _ModeKind = ...,
2385
- ) -> _SCT : ...
2385
+ ) -> _ScalarT : ...
2386
2386
@overload
2387
2387
def take ( # type: ignore[misc]
2388
2388
self ,
@@ -2494,12 +2494,12 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2494
2494
@overload
2495
2495
def astype (
2496
2496
self ,
2497
- dtype : _DTypeLike [_SCT ],
2497
+ dtype : _DTypeLike [_ScalarT ],
2498
2498
order : _OrderKACF = ...,
2499
2499
casting : _CastingKind = ...,
2500
2500
subok : builtins .bool = ...,
2501
2501
copy : builtins .bool | _CopyMode = ...,
2502
- ) -> ndarray [_ShapeT_co , dtype [_SCT ]]: ...
2502
+ ) -> ndarray [_ShapeT_co , dtype [_ScalarT ]]: ...
2503
2503
@overload
2504
2504
def astype (
2505
2505
self ,
@@ -2516,7 +2516,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2516
2516
@overload # (dtype: T)
2517
2517
def view (self , / , dtype : _DTypeT | _HasDType [_DTypeT ]) -> ndarray [_ShapeT_co , _DTypeT ]: ...
2518
2518
@overload # (dtype: dtype[T])
2519
- def view (self , / , dtype : _DTypeLike [_SCT ]) -> NDArray [_SCT ]: ...
2519
+ def view (self , / , dtype : _DTypeLike [_ScalarT ]) -> NDArray [_ScalarT ]: ...
2520
2520
@overload # (type: T)
2521
2521
def view (self , / , * , type : type [_ArrayT ]) -> _ArrayT : ...
2522
2522
@overload # (_: T)
@@ -2528,7 +2528,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2528
2528
2529
2529
def setfield (self , / , val : ArrayLike , dtype : DTypeLike , offset : CanIndex = 0 ) -> None : ...
2530
2530
@overload
2531
- def getfield (self , dtype : _DTypeLike [_SCT ], offset : SupportsIndex = 0 ) -> NDArray [_SCT ]: ...
2531
+ def getfield (self , dtype : _DTypeLike [_ScalarT ], offset : SupportsIndex = 0 ) -> NDArray [_ScalarT ]: ...
2532
2532
@overload
2533
2533
def getfield (self , dtype : DTypeLike , offset : SupportsIndex = 0 ) -> NDArray [Any ]: ...
2534
2534
@@ -2541,9 +2541,9 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2541
2541
@overload # == 1-d & object_
2542
2542
def __iter__ (self : ndarray [tuple [int ], dtype [object_ ]], / ) -> Iterator [Any ]: ...
2543
2543
@overload # == 1-d
2544
- def __iter__ (self : ndarray [tuple [int ], dtype [_SCT ]], / ) -> Iterator [_SCT ]: ...
2544
+ def __iter__ (self : ndarray [tuple [int ], dtype [_ScalarT ]], / ) -> Iterator [_ScalarT ]: ...
2545
2545
@overload # >= 2-d
2546
- def __iter__ (self : ndarray [tuple [int , int , Unpack [tuple [int , ...]]], dtype [_SCT ]], / ) -> Iterator [NDArray [_SCT ]]: ...
2546
+ def __iter__ (self : ndarray [tuple [int , int , Unpack [tuple [int , ...]]], dtype [_ScalarT ]], / ) -> Iterator [NDArray [_ScalarT ]]: ...
2547
2547
@overload # ?-d
2548
2548
def __iter__ (self , / ) -> Iterator [Any ]: ...
2549
2549
@@ -3571,12 +3571,12 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3571
3571
@overload
3572
3572
def astype (
3573
3573
self ,
3574
- dtype : _DTypeLike [_SCT ],
3574
+ dtype : _DTypeLike [_ScalarT ],
3575
3575
order : _OrderKACF = ...,
3576
3576
casting : _CastingKind = ...,
3577
3577
subok : builtins .bool = ...,
3578
3578
copy : builtins .bool | _CopyMode = ...,
3579
- ) -> _SCT : ...
3579
+ ) -> _ScalarT : ...
3580
3580
@overload
3581
3581
def astype (
3582
3582
self ,
@@ -3594,9 +3594,9 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3594
3594
@overload
3595
3595
def view (
3596
3596
self ,
3597
- dtype : _DTypeLike [_SCT ],
3597
+ dtype : _DTypeLike [_ScalarT ],
3598
3598
type : type [NDArray [Any ]] = ...,
3599
- ) -> _SCT : ...
3599
+ ) -> _ScalarT : ...
3600
3600
@overload
3601
3601
def view (
3602
3602
self ,
@@ -3607,9 +3607,9 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3607
3607
@overload
3608
3608
def getfield (
3609
3609
self ,
3610
- dtype : _DTypeLike [_SCT ],
3610
+ dtype : _DTypeLike [_ScalarT ],
3611
3611
offset : SupportsIndex = ...
3612
- ) -> _SCT : ...
3612
+ ) -> _ScalarT : ...
3613
3613
@overload
3614
3614
def getfield (
3615
3615
self ,
@@ -3747,21 +3747,21 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3747
3747
self ,
3748
3748
/ ,
3749
3749
axis : L [0 , - 1 ] | tuple [()] | None ,
3750
- out : ndarray [tuple [()], dtype [_SCT ]],
3750
+ out : ndarray [tuple [()], dtype [_ScalarT ]],
3751
3751
keepdims : SupportsIndex = False ,
3752
3752
* ,
3753
3753
where : builtins .bool | np .bool | ndarray [tuple [()], dtype [np .bool ]] = True ,
3754
- ) -> _SCT : ...
3754
+ ) -> _ScalarT : ...
3755
3755
@overload
3756
3756
def all (
3757
3757
self ,
3758
3758
/ ,
3759
3759
axis : L [0 , - 1 ] | tuple [()] | None = None ,
3760
3760
* ,
3761
- out : ndarray [tuple [()], dtype [_SCT ]],
3761
+ out : ndarray [tuple [()], dtype [_ScalarT ]],
3762
3762
keepdims : SupportsIndex = False ,
3763
3763
where : builtins .bool | np .bool | ndarray [tuple [()], dtype [np .bool ]] = True ,
3764
- ) -> _SCT : ...
3764
+ ) -> _ScalarT : ...
3765
3765
3766
3766
@overload
3767
3767
def any (
@@ -3778,21 +3778,21 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3778
3778
self ,
3779
3779
/ ,
3780
3780
axis : L [0 , - 1 ] | tuple [()] | None ,
3781
- out : ndarray [tuple [()], dtype [_SCT ]],
3781
+ out : ndarray [tuple [()], dtype [_ScalarT ]],
3782
3782
keepdims : SupportsIndex = False ,
3783
3783
* ,
3784
3784
where : builtins .bool | np .bool | ndarray [tuple [()], dtype [np .bool ]] = True ,
3785
- ) -> _SCT : ...
3785
+ ) -> _ScalarT : ...
3786
3786
@overload
3787
3787
def any (
3788
3788
self ,
3789
3789
/ ,
3790
3790
axis : L [0 , - 1 ] | tuple [()] | None = None ,
3791
3791
* ,
3792
- out : ndarray [tuple [()], dtype [_SCT ]],
3792
+ out : ndarray [tuple [()], dtype [_ScalarT ]],
3793
3793
keepdims : SupportsIndex = False ,
3794
3794
where : builtins .bool | np .bool | ndarray [tuple [()], dtype [np .bool ]] = True ,
3795
- ) -> _SCT : ...
3795
+ ) -> _ScalarT : ...
3796
3796
3797
3797
# Keep `dtype` at the bottom to avoid name conflicts with `np.dtype`
3798
3798
@property
@@ -5087,12 +5087,12 @@ class memmap(ndarray[_ShapeT_co, _DTypeT_co]):
5087
5087
def __new__ (
5088
5088
subtype ,
5089
5089
filename : StrOrBytesPath | _SupportsFileMethodsRW ,
5090
- dtype : _DTypeLike [_SCT ],
5090
+ dtype : _DTypeLike [_ScalarT ],
5091
5091
mode : _MemMapModeKind = ...,
5092
5092
offset : int = ...,
5093
5093
shape : None | int | tuple [int , ...] = ...,
5094
5094
order : _OrderKACF = ...,
5095
- ) -> memmap [Any , dtype [_SCT ]]: ...
5095
+ ) -> memmap [Any , dtype [_ScalarT ]]: ...
5096
5096
@overload
5097
5097
def __new__ (
5098
5098
subtype ,
@@ -5302,35 +5302,35 @@ class matrix(ndarray[_2DShapeT_co, _DTypeT_co]):
5302
5302
def all (self , axis : None | _ShapeLike = ..., out : _ArrayT = ...) -> _ArrayT : ...
5303
5303
5304
5304
@overload
5305
- def max (self : NDArray [_SCT ], axis : None = ..., out : None = ...) -> _SCT : ...
5305
+ def max (self : NDArray [_ScalarT ], axis : None = ..., out : None = ...) -> _ScalarT : ...
5306
5306
@overload
5307
5307
def max (self , axis : _ShapeLike , out : None = ...) -> matrix [_2D , _DTypeT_co ]: ...
5308
5308
@overload
5309
5309
def max (self , axis : None | _ShapeLike = ..., out : _ArrayT = ...) -> _ArrayT : ...
5310
5310
5311
5311
@overload
5312
- def min (self : NDArray [_SCT ], axis : None = ..., out : None = ...) -> _SCT : ...
5312
+ def min (self : NDArray [_ScalarT ], axis : None = ..., out : None = ...) -> _ScalarT : ...
5313
5313
@overload
5314
5314
def min (self , axis : _ShapeLike , out : None = ...) -> matrix [_2D , _DTypeT_co ]: ...
5315
5315
@overload
5316
5316
def min (self , axis : None | _ShapeLike = ..., out : _ArrayT = ...) -> _ArrayT : ...
5317
5317
5318
5318
@overload
5319
- def argmax (self : NDArray [_SCT ], axis : None = ..., out : None = ...) -> intp : ...
5319
+ def argmax (self : NDArray [_ScalarT ], axis : None = ..., out : None = ...) -> intp : ...
5320
5320
@overload
5321
5321
def argmax (self , axis : _ShapeLike , out : None = ...) -> matrix [_2D , dtype [intp ]]: ...
5322
5322
@overload
5323
5323
def argmax (self , axis : None | _ShapeLike = ..., out : _ArrayT = ...) -> _ArrayT : ...
5324
5324
5325
5325
@overload
5326
- def argmin (self : NDArray [_SCT ], axis : None = ..., out : None = ...) -> intp : ...
5326
+ def argmin (self : NDArray [_ScalarT ], axis : None = ..., out : None = ...) -> intp : ...
5327
5327
@overload
5328
5328
def argmin (self , axis : _ShapeLike , out : None = ...) -> matrix [_2D , dtype [intp ]]: ...
5329
5329
@overload
5330
5330
def argmin (self , axis : None | _ShapeLike = ..., out : _ArrayT = ...) -> _ArrayT : ...
5331
5331
5332
5332
@overload
5333
- def ptp (self : NDArray [_SCT ], axis : None = ..., out : None = ...) -> _SCT : ...
5333
+ def ptp (self : NDArray [_ScalarT ], axis : None = ..., out : None = ...) -> _ScalarT : ...
5334
5334
@overload
5335
5335
def ptp (self , axis : _ShapeLike , out : None = ...) -> matrix [_2D , _DTypeT_co ]: ...
5336
5336
@overload
0 commit comments