diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-12-21 20:24:22 +0100 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-12-23 21:15:00 +0100 |
commit | 7b5f39b5eeac583f822741eaf95a8229f2b5f8d7 (patch) | |
tree | a7a83a47f39d1e4e29becb5f835158e4b1c86e3a /numpy/core/function_base.pyi | |
parent | 99ed44df750fedfc0bbf956c88d15befd5e760cd (diff) | |
download | numpy-7b5f39b5eeac583f822741eaf95a8229f2b5f8d7.tar.gz |
STY: Use subscriptable `builtins` types over the generic aliases in `typing`
Diffstat (limited to 'numpy/core/function_base.pyi')
-rw-r--r-- | numpy/core/function_base.pyi | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/numpy/core/function_base.pyi b/numpy/core/function_base.pyi index 6e0843a0e..b21892177 100644 --- a/numpy/core/function_base.pyi +++ b/numpy/core/function_base.pyi @@ -1,12 +1,9 @@ from typing import ( Literal as L, overload, - Tuple, Union, Any, SupportsIndex, - List, - Type, TypeVar, ) @@ -26,11 +23,11 @@ _SCT = TypeVar("_SCT", bound=generic) _DTypeLike = Union[ dtype[_SCT], - Type[_SCT], + type[_SCT], _SupportsDType[dtype[_SCT]], ] -__all__: List[str] +__all__: list[str] @overload def linspace( @@ -81,7 +78,7 @@ def linspace( retstep: L[True] = ..., dtype: None = ..., axis: SupportsIndex = ..., -) -> Tuple[NDArray[floating[Any]], floating[Any]]: ... +) -> tuple[NDArray[floating[Any]], floating[Any]]: ... @overload def linspace( start: _ArrayLikeComplex_co, @@ -91,7 +88,7 @@ def linspace( retstep: L[True] = ..., dtype: None = ..., axis: SupportsIndex = ..., -) -> Tuple[NDArray[complexfloating[Any, Any]], complexfloating[Any, Any]]: ... +) -> tuple[NDArray[complexfloating[Any, Any]], complexfloating[Any, Any]]: ... @overload def linspace( start: _ArrayLikeComplex_co, @@ -101,7 +98,7 @@ def linspace( retstep: L[True] = ..., dtype: _DTypeLike[_SCT] = ..., axis: SupportsIndex = ..., -) -> Tuple[NDArray[_SCT], _SCT]: ... +) -> tuple[NDArray[_SCT], _SCT]: ... @overload def linspace( start: _ArrayLikeComplex_co, @@ -111,7 +108,7 @@ def linspace( retstep: L[True] = ..., dtype: DTypeLike = ..., axis: SupportsIndex = ..., -) -> Tuple[NDArray[Any], Any]: ... +) -> tuple[NDArray[Any], Any]: ... @overload def logspace( @@ -195,6 +192,6 @@ def geomspace( def add_newdoc( place: str, obj: str, - doc: str | Tuple[str, str] | List[Tuple[str, str]], + doc: str | tuple[str, str] | list[tuple[str, str]], warn_on_python: bool = ..., ) -> None: ... |