diff --git a/numpy-stubs/__init__.pyi b/numpy-stubs/__init__.pyi index 85c777c..0732266 100644 --- a/numpy-stubs/__init__.pyi +++ b/numpy-stubs/__init__.pyi @@ -483,6 +483,9 @@ def zeros( def ones( shape: _ShapeLike, dtype: DtypeLike = ..., order: Optional[str] = ... ) -> ndarray: ... +def empty( + shape: _ShapeLike, dtype: DtypeLike = ..., order: Optional[str] = ... +) -> ndarray: ... def zeros_like( a: ArrayLike, dtype: DtypeLike = ..., @@ -496,7 +499,14 @@ def ones_like( order: str = ..., subok: bool = ..., shape: Optional[_ShapeLike] = ..., -) -> ndarray[int]: ... +) -> ndarray: ... +def empty_like( + a: ArrayLike, + dtype: DtypeLike = ..., + order: str = ..., + subok: bool = ..., + shape: Optional[_ShapeLike] = ..., +) -> ndarray: ... def full( shape: _ShapeLike, fill_value: Any, dtype: DtypeLike = ..., order: str = ... ) -> ndarray: ... diff --git a/tests/pass/simple.py b/tests/pass/simple.py index 8da0d58..53562a3 100644 --- a/tests/pass/simple.py +++ b/tests/pass/simple.py @@ -20,6 +20,11 @@ def ndarray_func(x): # Array creation routines checks ndarray_func(np.zeros([1, 2])) ndarray_func(np.ones([1, 2])) +ndarray_func(np.empty([1, 2])) + +ndarray_func(np.zeros_like(array)) +ndarray_func(np.ones_like(array)) +ndarray_func(np.empty_like(array)) # Dtype construction np.dtype(float)