summaryrefslogtreecommitdiff
path: root/numpy/core/function_base.pyi
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/function_base.pyi')
-rw-r--r--numpy/core/function_base.pyi15
1 files changed, 7 insertions, 8 deletions
diff --git a/numpy/core/function_base.pyi b/numpy/core/function_base.pyi
index 1490bed4a..b5d6ca6ab 100644
--- a/numpy/core/function_base.pyi
+++ b/numpy/core/function_base.pyi
@@ -1,21 +1,18 @@
import sys
from typing import overload, Tuple, Union, Sequence, Any
-from numpy import ndarray, inexact
-from numpy.typing import ArrayLike, DTypeLike, _SupportsArray, _NumberLike
+from numpy import ndarray
+from numpy.typing import ArrayLike, DTypeLike, _SupportsArray, _NumberLike_co
if sys.version_info >= (3, 8):
from typing import SupportsIndex, Literal
else:
- from typing_extensions import Literal, Protocol
-
- class SupportsIndex(Protocol):
- def __index__(self) -> int: ...
+ from typing_extensions import SupportsIndex, Literal
# TODO: wait for support for recursive types
_ArrayLikeNested = Sequence[Sequence[Any]]
_ArrayLikeNumber = Union[
- _NumberLike, Sequence[_NumberLike], ndarray, _SupportsArray, _ArrayLikeNested
+ _NumberLike_co, Sequence[_NumberLike_co], ndarray, _SupportsArray, _ArrayLikeNested
]
@overload
def linspace(
@@ -36,7 +33,8 @@ def linspace(
retstep: Literal[True] = ...,
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
-) -> Tuple[ndarray, inexact]: ...
+) -> Tuple[ndarray, Any]: ...
+
def logspace(
start: _ArrayLikeNumber,
stop: _ArrayLikeNumber,
@@ -46,6 +44,7 @@ def logspace(
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
) -> ndarray: ...
+
def geomspace(
start: _ArrayLikeNumber,
stop: _ArrayLikeNumber,