summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi28
-rw-r--r--numpy/core/multiarray.pyi57
2 files changed, 60 insertions, 25 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index d5efe19bb..4e68387a8 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -295,7 +295,10 @@ from numpy.core.einsumfunc import (
)
from numpy.core.multiarray import (
+ array as array,
empty_like as empty_like,
+ empty as empty,
+ zeros as zeros,
)
from numpy.core.numeric import (
@@ -3420,31 +3423,6 @@ class str_(character, str):
unicode_ = str_
str0 = str_
-def array(
- object: object,
- dtype: DTypeLike = ...,
- *,
- copy: bool = ...,
- order: _OrderKACF = ...,
- subok: bool = ...,
- ndmin: int = ...,
- like: ArrayLike = ...,
-) -> ndarray: ...
-def zeros(
- shape: _ShapeLike,
- dtype: DTypeLike = ...,
- order: _OrderCF = ...,
- *,
- like: ArrayLike = ...,
-) -> ndarray: ...
-def empty(
- shape: _ShapeLike,
- dtype: DTypeLike = ...,
- order: _OrderCF = ...,
- *,
- like: ArrayLike = ...,
-) -> ndarray: ...
-
#
# Constants
#
diff --git a/numpy/core/multiarray.pyi b/numpy/core/multiarray.pyi
index cd8518ed6..0080dc303 100644
--- a/numpy/core/multiarray.pyi
+++ b/numpy/core/multiarray.pyi
@@ -29,3 +29,60 @@ def empty_like(
subok: bool = ...,
shape: Optional[_ShapeLike] = ...,
) -> NDArray[Any]: ...
+
+@overload
+def array(
+ object: object,
+ dtype: _DTypeLike[_SCT],
+ *,
+ copy: bool = ...,
+ order: _OrderKACF = ...,
+ subok: bool = ...,
+ ndmin: int = ...,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def array(
+ object: object,
+ dtype: DTypeLike = ...,
+ *,
+ copy: bool = ...,
+ order: _OrderKACF = ...,
+ subok: bool = ...,
+ ndmin: int = ...,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...
+
+@overload
+def zeros(
+ shape: _ShapeLike,
+ dtype: _DTypeLike[_SCT],
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def zeros(
+ shape: _ShapeLike,
+ dtype: DTypeLike = ...,
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...
+
+@overload
+def empty(
+ shape: _ShapeLike,
+ dtype: _DTypeLike[_SCT],
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def empty(
+ shape: _ShapeLike,
+ dtype: DTypeLike = ...,
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...