@@ -22,7 +22,6 @@ from numpy._typing import (
22
22
NDArray ,
23
23
_SupportsArray ,
24
24
_NestedSequence ,
25
- _FiniteNestedSequence ,
26
25
_ArrayLike ,
27
26
_ArrayLikeBool_co ,
28
27
_ArrayLikeUInt_co ,
@@ -33,28 +32,27 @@ from numpy._typing import (
33
32
_ArrayLikeComplex128_co ,
34
33
_ArrayLikeComplex_co ,
35
34
_ArrayLikeNumber_co ,
35
+ _ArrayLikeObject_co ,
36
+ _ArrayLikeBytes_co ,
37
+ _ArrayLikeStr_co ,
38
+ _ArrayLikeString_co ,
36
39
_ArrayLikeTD64_co ,
37
40
_ArrayLikeDT64_co ,
38
- _ArrayLikeObject_co ,
39
-
40
41
# DTypes
41
42
DTypeLike ,
42
43
_DTypeLike ,
43
44
_DTypeLikeVoid ,
44
45
_VoidDTypeLike ,
45
-
46
46
# Shapes
47
47
_Shape ,
48
48
_ShapeLike ,
49
-
50
49
# Scalars
51
50
_CharLike_co ,
52
51
_IntLike_co ,
53
52
_FloatLike_co ,
54
53
_TD64Like_co ,
55
54
_NumberLike_co ,
56
55
_ScalarLike_co ,
57
-
58
56
# `number` precision
59
57
NBitBase ,
60
58
# NOTE: Do not remove the extended precision bit-types even if seemingly unused;
@@ -77,7 +75,6 @@ from numpy._typing import (
77
75
_NBitSingle ,
78
76
_NBitDouble ,
79
77
_NBitLongDouble ,
80
-
81
78
# Character codes
82
79
_BoolCodes ,
83
80
_UInt8Codes ,
@@ -119,7 +116,6 @@ from numpy._typing import (
119
116
_VoidCodes ,
120
117
_ObjectCodes ,
121
118
_StringCodes ,
122
-
123
119
_UnsignedIntegerCodes ,
124
120
_SignedIntegerCodes ,
125
121
_IntegerCodes ,
@@ -130,7 +126,6 @@ from numpy._typing import (
130
126
_CharacterCodes ,
131
127
_FlexibleCodes ,
132
128
_GenericCodes ,
133
-
134
129
# Ufuncs
135
130
_UFunc_Nin1_Nout1 ,
136
131
_UFunc_Nin2_Nout1 ,
@@ -2547,55 +2542,77 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2547
2542
@overload # ?-d
2548
2543
def __iter__ (self , / ) -> Iterator [Any ]: ...
2549
2544
2550
- # The last overload is for catching recursive objects whose
2551
- # nesting is too deep.
2552
- # The first overload is for catching `bytes` (as they are a subtype of
2553
- # `Sequence[int]`) and `str`. As `str` is a recursive sequence of
2554
- # strings, it will pass through the final overload otherwise
2555
-
2545
+ #
2556
2546
@overload
2557
2547
def __lt__ (self : _ArrayNumber_co , other : _ArrayLikeNumber_co , / ) -> NDArray [np .bool ]: ...
2558
2548
@overload
2559
2549
def __lt__ (self : _ArrayTD64_co , other : _ArrayLikeTD64_co , / ) -> NDArray [np .bool ]: ...
2560
2550
@overload
2561
2551
def __lt__ (self : NDArray [datetime64 ], other : _ArrayLikeDT64_co , / ) -> NDArray [np .bool ]: ...
2562
2552
@overload
2563
- def __lt__ (self : NDArray [object_ ], other : Any , / ) -> NDArray [np .bool ]: ...
2553
+ def __lt__ (self : NDArray [bytes_ ], other : _ArrayLikeBytes_co , / ) -> NDArray [np .bool ]: ...
2564
2554
@overload
2565
- def __lt__ (self : NDArray [Any ], other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2555
+ def __lt__ (
2556
+ self : ndarray [Any , dtype [str_ ] | dtypes .StringDType ], other : _ArrayLikeStr_co | _ArrayLikeString_co , /
2557
+ ) -> NDArray [np .bool ]: ...
2558
+ @overload
2559
+ def __lt__ (self : NDArray [object_ ], other : object , / ) -> NDArray [np .bool ]: ...
2560
+ @overload
2561
+ def __lt__ (self , other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2566
2562
2563
+ #
2567
2564
@overload
2568
2565
def __le__ (self : _ArrayNumber_co , other : _ArrayLikeNumber_co , / ) -> NDArray [np .bool ]: ...
2569
2566
@overload
2570
2567
def __le__ (self : _ArrayTD64_co , other : _ArrayLikeTD64_co , / ) -> NDArray [np .bool ]: ...
2571
2568
@overload
2572
2569
def __le__ (self : NDArray [datetime64 ], other : _ArrayLikeDT64_co , / ) -> NDArray [np .bool ]: ...
2573
2570
@overload
2574
- def __le__ (self : NDArray [object_ ], other : Any , / ) -> NDArray [np .bool ]: ...
2571
+ def __le__ (self : NDArray [bytes_ ], other : _ArrayLikeBytes_co , / ) -> NDArray [np .bool ]: ...
2575
2572
@overload
2576
- def __le__ (self : NDArray [Any ], other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2573
+ def __le__ (
2574
+ self : ndarray [Any , dtype [str_ ] | dtypes .StringDType ], other : _ArrayLikeStr_co | _ArrayLikeString_co , /
2575
+ ) -> NDArray [np .bool ]: ...
2576
+ @overload
2577
+ def __le__ (self : NDArray [object_ ], other : object , / ) -> NDArray [np .bool ]: ...
2578
+ @overload
2579
+ def __le__ (self , other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2577
2580
2581
+ #
2578
2582
@overload
2579
2583
def __gt__ (self : _ArrayNumber_co , other : _ArrayLikeNumber_co , / ) -> NDArray [np .bool ]: ...
2580
2584
@overload
2581
2585
def __gt__ (self : _ArrayTD64_co , other : _ArrayLikeTD64_co , / ) -> NDArray [np .bool ]: ...
2582
2586
@overload
2583
2587
def __gt__ (self : NDArray [datetime64 ], other : _ArrayLikeDT64_co , / ) -> NDArray [np .bool ]: ...
2584
2588
@overload
2585
- def __gt__ (self : NDArray [object_ ], other : Any , / ) -> NDArray [np .bool ]: ...
2589
+ def __gt__ (self : NDArray [bytes_ ], other : _ArrayLikeBytes_co , / ) -> NDArray [np .bool ]: ...
2586
2590
@overload
2587
- def __gt__ (self : NDArray [Any ], other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2591
+ def __gt__ (
2592
+ self : ndarray [Any , dtype [str_ ] | dtypes .StringDType ], other : _ArrayLikeStr_co | _ArrayLikeString_co , /
2593
+ ) -> NDArray [np .bool ]: ...
2594
+ @overload
2595
+ def __gt__ (self : NDArray [object_ ], other : object , / ) -> NDArray [np .bool ]: ...
2596
+ @overload
2597
+ def __gt__ (self , other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2588
2598
2599
+ #
2589
2600
@overload
2590
2601
def __ge__ (self : _ArrayNumber_co , other : _ArrayLikeNumber_co , / ) -> NDArray [np .bool ]: ...
2591
2602
@overload
2592
2603
def __ge__ (self : _ArrayTD64_co , other : _ArrayLikeTD64_co , / ) -> NDArray [np .bool ]: ...
2593
2604
@overload
2594
2605
def __ge__ (self : NDArray [datetime64 ], other : _ArrayLikeDT64_co , / ) -> NDArray [np .bool ]: ...
2595
2606
@overload
2596
- def __ge__ (self : NDArray [object_ ], other : Any , / ) -> NDArray [np .bool ]: ...
2607
+ def __ge__ (self : NDArray [bytes_ ], other : _ArrayLikeBytes_co , / ) -> NDArray [np .bool ]: ...
2608
+ @overload
2609
+ def __ge__ (
2610
+ self : ndarray [Any , dtype [str_ ] | dtypes .StringDType ], other : _ArrayLikeStr_co | _ArrayLikeString_co , /
2611
+ ) -> NDArray [np .bool ]: ...
2612
+ @overload
2613
+ def __ge__ (self : NDArray [object_ ], other : object , / ) -> NDArray [np .bool ]: ...
2597
2614
@overload
2598
- def __ge__ (self : NDArray [ Any ] , other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2615
+ def __ge__ (self , other : _ArrayLikeObject_co , / ) -> NDArray [np .bool ]: ...
2599
2616
2600
2617
# Unary ops
2601
2618
0 commit comments