Skip to content

Commit

Permalink
added where typehints to __init__.pyi
Browse files Browse the repository at this point in the history
  • Loading branch information
janusheide authored and charris committed Jan 29, 2022
1 parent 1e1739f commit b48b73b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1030,20 +1030,26 @@ class _ArrayOrScalarCommon:
axis: None = ...,
out: None = ...,
keepdims: L[False] = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> bool_: ...
@overload
def all(
self,
axis: Optional[_ShapeLike] = ...,
out: None = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> Any: ...
@overload
def all(
self,
axis: Optional[_ShapeLike] = ...,
out: _NdArraySubClass = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> _NdArraySubClass: ...

@overload
Expand All @@ -1052,20 +1058,26 @@ class _ArrayOrScalarCommon:
axis: None = ...,
out: None = ...,
keepdims: L[False] = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> bool_: ...
@overload
def any(
self,
axis: Optional[_ShapeLike] = ...,
out: None = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> Any: ...
@overload
def any(
self,
axis: Optional[_ShapeLike] = ...,
out: _NdArraySubClass = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> _NdArraySubClass: ...

@overload
Expand Down Expand Up @@ -1248,6 +1260,8 @@ class _ArrayOrScalarCommon:
dtype: DTypeLike = ...,
out: None = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> Any: ...
@overload
def mean(
Expand All @@ -1256,6 +1270,8 @@ class _ArrayOrScalarCommon:
dtype: DTypeLike = ...,
out: _NdArraySubClass = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> _NdArraySubClass: ...

@overload
Expand Down Expand Up @@ -1339,6 +1355,8 @@ class _ArrayOrScalarCommon:
out: None = ...,
ddof: int = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> Any: ...
@overload
def std(
Expand All @@ -1348,6 +1366,8 @@ class _ArrayOrScalarCommon:
out: _NdArraySubClass = ...,
ddof: int = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> _NdArraySubClass: ...

@overload
Expand Down Expand Up @@ -1379,6 +1399,8 @@ class _ArrayOrScalarCommon:
out: None = ...,
ddof: int = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> Any: ...
@overload
def var(
Expand All @@ -1388,6 +1410,8 @@ class _ArrayOrScalarCommon:
out: _NdArraySubClass = ...,
ddof: int = ...,
keepdims: bool = ...,
*,
where: _ArrayLikeBool_co = ...,
) -> _NdArraySubClass: ...

_DType = TypeVar("_DType", bound=dtype[Any])
Expand Down

0 comments on commit b48b73b

Please sign in to comment.