@@ -814,10 +814,10 @@ _ScalarBuiltin = Union[str, bytes, dt.date, dt.timedelta, bool, int, float, comp
814
814
_Scalar = Union [_ScalarBuiltin , _ScalarNumpy ]
815
815
816
816
# Integers and booleans can generally be used interchangeably
817
- _ScalarInt = TypeVar ("_ScalarInt " , bound = Union [integer , bool_ ])
817
+ _ScalarIntOrBool = TypeVar ("_ScalarIntOrBool " , bound = Union [integer , bool_ ])
818
818
_ScalarGeneric = TypeVar ("_ScalarGeneric" , bound = generic )
819
- _ScalarGenericPlus = TypeVar (
820
- "_ScalarGenericPlus " , bound = Union [dt .datetime , dt .timedelta , generic ]
819
+ _ScalarGenericDT = TypeVar (
820
+ "_ScalarGenericDT " , bound = Union [dt .datetime , dt .timedelta , generic ]
821
821
)
822
822
823
823
# An array-like object consisting of integers
@@ -827,11 +827,11 @@ _ArrayLikeIntNested = Any # TODO: wait for support for recursive types
827
827
_ArrayLikeBoolNested = Any # TODO: wait for support for recursive types
828
828
829
829
# Integers and booleans can generally be used interchangeably
830
- _ArrayLikeInt = Union [
830
+ _ArrayLikeIntOrBool = Union [
831
831
_Int ,
832
832
ndarray ,
833
833
Sequence [_Int ],
834
- Sequence [_ArrayLikeIntNested ],
834
+ Sequence [_ArrayLikeIntOrBoolNested ],
835
835
Sequence [_ArrayLikeBoolNested ],
836
836
]
837
837
@@ -842,12 +842,12 @@ _ArrayLikeInt = Union[
842
842
# 4. An array-like object comes in; an ndarray or generic comes out
843
843
@overload
844
844
def take (
845
- a : _ScalarGenericPlus ,
845
+ a : _ScalarGenericDT ,
846
846
indices : int ,
847
847
axis : Optional [int ] = ...,
848
848
out : Optional [ndarray ] = ...,
849
849
mode : _Mode = ...,
850
- ) -> _ScalarGenericPlus : ...
850
+ ) -> _ScalarGenericDT : ...
851
851
@overload
852
852
def take (
853
853
a : _Scalar ,
@@ -867,19 +867,19 @@ def take(
867
867
@overload
868
868
def take (
869
869
a : _ArrayLike ,
870
- indices : _ArrayLikeInt ,
870
+ indices : _ArrayLikeIntOrBool ,
871
871
axis : Optional [int ] = ...,
872
872
out : Optional [ndarray ] = ...,
873
873
mode : _Mode = ...,
874
874
) -> Union [_ScalarNumpy , ndarray ]: ...
875
875
def reshape (a : _ArrayLike , newshape : _ShapeLike , order : _Order = ...) -> ndarray : ...
876
876
@overload
877
877
def choose (
878
- a : _ScalarInt ,
878
+ a : _ScalarIntOrBool ,
879
879
choices : Union [Sequence [_ArrayLike ], ndarray ],
880
880
out : Optional [ndarray ] = ...,
881
881
mode : _Mode = ...,
882
- ) -> _ScalarInt : ...
882
+ ) -> _ScalarIntOrBool : ...
883
883
@overload
884
884
def choose (
885
885
a : _Int ,
@@ -889,15 +889,17 @@ def choose(
889
889
) -> Union [integer , bool_ ]: ...
890
890
@overload
891
891
def choose (
892
- a : _ArrayLikeInt ,
892
+ a : _ArrayLikeIntOrBool ,
893
893
choices : Union [Sequence [_ArrayLike ], ndarray ],
894
894
out : Optional [ndarray ] = ...,
895
895
mode : _Mode = ...,
896
896
) -> ndarray : ...
897
897
def repeat (
898
- a : _ArrayLike , repeats : _ArrayLikeInt , axis : Optional [int ] = ...
898
+ a : _ArrayLike , repeats : _ArrayLikeIntOrBool , axis : Optional [int ] = ...
899
899
) -> ndarray : ...
900
- def put (a : ndarray , ind : _ArrayLikeInt , v : _ArrayLike , mode : _Mode = ...) -> None : ...
900
+ def put (
901
+ a : ndarray , ind : _ArrayLikeIntOrBool , v : _ArrayLike , mode : _Mode = ...
902
+ ) -> None : ...
901
903
def swapaxes (
902
904
a : Union [Sequence [_ArrayLike ], ndarray ], axis1 : int , axis2 : int
903
905
) -> ndarray : ...
@@ -906,31 +908,31 @@ def transpose(
906
908
) -> ndarray : ...
907
909
def partition (
908
910
a : _ArrayLike ,
909
- kth : _ArrayLikeInt ,
911
+ kth : _ArrayLikeIntOrBool ,
910
912
axis : Optional [int ] = ...,
911
913
kind : _PartitionKind = ...,
912
914
order : Union [None , str , Sequence [str ]] = ...,
913
915
) -> ndarray : ...
914
916
@overload
915
917
def argpartition (
916
918
a : generic ,
917
- kth : _ArrayLikeInt ,
919
+ kth : _ArrayLikeIntOrBool ,
918
920
axis : Optional [int ] = ...,
919
921
kind : _PartitionKind = ...,
920
922
order : Union [None , str , Sequence [str ]] = ...,
921
923
) -> integer : ...
922
924
@overload
923
925
def argpartition (
924
926
a : _ScalarBuiltin ,
925
- kth : _ArrayLikeInt ,
927
+ kth : _ArrayLikeIntOrBool ,
926
928
axis : Optional [int ] = ...,
927
929
kind : _PartitionKind = ...,
928
930
order : Union [None , str , Sequence [str ]] = ...,
929
931
) -> ndarray : ...
930
932
@overload
931
933
def argpartition (
932
934
a : _ArrayLike ,
933
- kth : _ArrayLikeInt ,
935
+ kth : _ArrayLikeIntOrBool ,
934
936
axis : Optional [int ] = ...,
935
937
kind : _PartitionKind = ...,
936
938
order : Union [None , str , Sequence [str ]] = ...,
0 commit comments