summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/random/_generator.pyi27
1 files changed, 18 insertions, 9 deletions
diff --git a/numpy/random/_generator.pyi b/numpy/random/_generator.pyi
index e40207a3d..aadc4d0f8 100644
--- a/numpy/random/_generator.pyi
+++ b/numpy/random/_generator.pyi
@@ -159,7 +159,16 @@ class Generator:
low: int,
high: Optional[int] = ...,
size: None = ...,
- dtype: Union[_DTypeLikeBool, _DTypeLikeInt, _DTypeLikeUInt] = ...,
+ dtype: _DTypeLikeBool = ...,
+ endpoint: bool = ...,
+ ) -> bool: ...
+ @overload
+ def integers( # type: ignore[misc]
+ self,
+ low: int,
+ high: Optional[int] = ...,
+ size: None = ...,
+ dtype: Union[_DTypeLikeInt, _DTypeLikeUInt] = ...,
endpoint: bool = ...,
) -> int: ...
@overload
@@ -169,30 +178,30 @@ class Generator:
high: Optional[_ArrayLikeInt_co] = ...,
size: Optional[_ShapeLike] = ...,
dtype: Union[
- dtype[int_], Type[int], Type[int_], _IntCodes, _SupportsDType[dtype[int_]]
+ dtype[bool_], Type[bool], Type[bool_], _BoolCodes, _SupportsDType[dtype[bool_]]
] = ...,
endpoint: bool = ...,
- ) -> ndarray[Any, dtype[int_]]: ...
+ ) -> ndarray[Any, dtype[bool_]]: ...
@overload
def integers( # type: ignore[misc]
self,
low: _ArrayLikeInt_co,
high: Optional[_ArrayLikeInt_co] = ...,
size: Optional[_ShapeLike] = ...,
- dtype: Union[dtype[uint], Type[uint], _UIntCodes, _SupportsDType[dtype[uint]]] = ...,
+ dtype: Union[
+ dtype[int_], Type[int], Type[int_], _IntCodes, _SupportsDType[dtype[int_]]
+ ] = ...,
endpoint: bool = ...,
- ) -> ndarray[Any, dtype[uint]]: ...
+ ) -> ndarray[Any, dtype[int_]]: ...
@overload
def integers( # type: ignore[misc]
self,
low: _ArrayLikeInt_co,
high: Optional[_ArrayLikeInt_co] = ...,
size: Optional[_ShapeLike] = ...,
- dtype: Union[
- dtype[bool_], Type[bool], Type[bool_], _BoolCodes, _SupportsDType[dtype[bool_]]
- ] = ...,
+ dtype: Union[dtype[uint], Type[uint], _UIntCodes, _SupportsDType[dtype[uint]]] = ...,
endpoint: bool = ...,
- ) -> ndarray[Any, dtype[bool_]]: ...
+ ) -> ndarray[Any, dtype[uint]]: ...
@overload
def integers( # type: ignore[misc]
self,