summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-04-21 18:06:36 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-04-30 22:09:51 +0200
commitb1eaa4033d9a8a62d7789e112db6d74fe897d42b (patch)
treeff9388c3d7ebde1c5784516896ee29d1df2a25f1 /numpy
parent9d023167249bd1cfc2c3161483b8253b313b0b46 (diff)
downloadnumpy-b1eaa4033d9a8a62d7789e112db6d74fe897d42b.tar.gz
MAINT: Remove unsafe unions from `np.core.function_base`
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/function_base.pyi6
-rw-r--r--numpy/typing/tests/data/reveal/array_constructors.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/function_base.pyi b/numpy/core/function_base.pyi
index d4543f281..b5d6ca6ab 100644
--- a/numpy/core/function_base.pyi
+++ b/numpy/core/function_base.pyi
@@ -1,7 +1,7 @@
import sys
from typing import overload, Tuple, Union, Sequence, Any
-from numpy import ndarray, inexact
+from numpy import ndarray
from numpy.typing import ArrayLike, DTypeLike, _SupportsArray, _NumberLike_co
if sys.version_info >= (3, 8):
@@ -33,7 +33,8 @@ def linspace(
retstep: Literal[True] = ...,
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
-) -> Tuple[ndarray, inexact]: ...
+) -> Tuple[ndarray, Any]: ...
+
def logspace(
start: _ArrayLikeNumber,
stop: _ArrayLikeNumber,
@@ -43,6 +44,7 @@ def logspace(
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
) -> ndarray: ...
+
def geomspace(
start: _ArrayLikeNumber,
stop: _ArrayLikeNumber,
diff --git a/numpy/typing/tests/data/reveal/array_constructors.py b/numpy/typing/tests/data/reveal/array_constructors.py
index 04d5cd229..2e803a365 100644
--- a/numpy/typing/tests/data/reveal/array_constructors.py
+++ b/numpy/typing/tests/data/reveal/array_constructors.py
@@ -41,7 +41,7 @@ reveal_type(np.require(B, requirements="A")) # E: SubClass
reveal_type(np.require(C)) # E: numpy.ndarray[Any, Any]
reveal_type(np.linspace(0, 10)) # E: numpy.ndarray[Any, Any]
-reveal_type(np.linspace(0, 10, retstep=True)) # E: Tuple[numpy.ndarray[Any, Any], numpy.inexact[Any]]
+reveal_type(np.linspace(0, 10, retstep=True)) # E: Tuple[numpy.ndarray[Any, Any], Any]
reveal_type(np.logspace(0, 10)) # E: numpy.ndarray[Any, Any]
reveal_type(np.geomspace(1, 10)) # E: numpy.ndarray[Any, Any]