summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorBas van Beek <43369155+BvB93@users.noreply.github.com>2021-12-21 20:24:22 +0100
committerBas van Beek <43369155+BvB93@users.noreply.github.com>2021-12-23 21:15:00 +0100
commit7b5f39b5eeac583f822741eaf95a8229f2b5f8d7 (patch)
treea7a83a47f39d1e4e29becb5f835158e4b1c86e3a /numpy/core
parent99ed44df750fedfc0bbf956c88d15befd5e760cd (diff)
downloadnumpy-7b5f39b5eeac583f822741eaf95a8229f2b5f8d7.tar.gz
STY: Use subscriptable `builtins` types over the generic aliases in `typing`
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/_internal.pyi8
-rw-r--r--numpy/core/_type_aliases.pyi14
-rw-r--r--numpy/core/arrayprint.pyi2
-rw-r--r--numpy/core/defchararray.pyi3
-rw-r--r--numpy/core/einsumfunc.pyi6
-rw-r--r--numpy/core/fromnumeric.pyi4
-rw-r--r--numpy/core/function_base.pyi17
-rw-r--r--numpy/core/getlimits.pyi4
-rw-r--r--numpy/core/memmap.pyi4
-rw-r--r--numpy/core/multiarray.pyi27
-rw-r--r--numpy/core/numeric.pyi31
-rw-r--r--numpy/core/numerictypes.pyi100
-rw-r--r--numpy/core/records.pyi8
-rw-r--r--numpy/core/shape_base.pyi10
14 files changed, 109 insertions, 129 deletions
diff --git a/numpy/core/_internal.pyi b/numpy/core/_internal.pyi
index 51b2a87dd..8a25ef2cb 100644
--- a/numpy/core/_internal.pyi
+++ b/numpy/core/_internal.pyi
@@ -1,4 +1,4 @@
-from typing import Any, TypeVar, Type, overload, Generic
+from typing import Any, TypeVar, overload, Generic
import ctypes as ct
from numpy import ndarray
@@ -25,6 +25,6 @@ class _ctypes(Generic[_PT]):
@property
def _as_parameter_(self) -> ct.c_void_p: ...
- def data_as(self, obj: Type[_CastT]) -> _CastT: ...
- def shape_as(self, obj: Type[_CT]) -> ct.Array[_CT]: ...
- def strides_as(self, obj: Type[_CT]) -> ct.Array[_CT]: ...
+ def data_as(self, obj: type[_CastT]) -> _CastT: ...
+ def shape_as(self, obj: type[_CT]) -> ct.Array[_CT]: ...
+ def strides_as(self, obj: type[_CT]) -> ct.Array[_CT]: ...
diff --git a/numpy/core/_type_aliases.pyi b/numpy/core/_type_aliases.pyi
index 660b1d2b6..bbead0cb5 100644
--- a/numpy/core/_type_aliases.pyi
+++ b/numpy/core/_type_aliases.pyi
@@ -1,13 +1,13 @@
-from typing import Dict, Type, List, TypedDict
+from typing import TypedDict
from numpy import generic, signedinteger, unsignedinteger, floating, complexfloating
class _SCTypes(TypedDict):
- int: List[Type[signedinteger]]
- uint: List[Type[unsignedinteger]]
- float: List[Type[floating]]
- complex: List[Type[complexfloating]]
- others: List[type]
+ int: list[type[signedinteger]]
+ uint: list[type[unsignedinteger]]
+ float: list[type[floating]]
+ complex: list[type[complexfloating]]
+ others: list[type]
-sctypeDict: Dict[int | str, Type[generic]]
+sctypeDict: dict[int | str, type[generic]]
sctypes: _SCTypes
diff --git a/numpy/core/arrayprint.pyi b/numpy/core/arrayprint.pyi
index 5c33a21d3..acbec84e4 100644
--- a/numpy/core/arrayprint.pyi
+++ b/numpy/core/arrayprint.pyi
@@ -1,5 +1,5 @@
from types import TracebackType
-from typing import Any, Callable, Type, Literal, TypedDict, SupportsIndex
+from typing import Any, Callable, Literal, TypedDict, SupportsIndex
# Using a private class is by no means ideal, but it is simply a consequence
# of a `contextlib.context` returning an instance of aforementioned class
diff --git a/numpy/core/defchararray.pyi b/numpy/core/defchararray.pyi
index 28d247b05..250706eb1 100644
--- a/numpy/core/defchararray.pyi
+++ b/numpy/core/defchararray.pyi
@@ -3,7 +3,6 @@ from typing import (
overload,
TypeVar,
Any,
- List,
)
from numpy import (
@@ -30,7 +29,7 @@ from numpy.core.multiarray import compare_chararrays as compare_chararrays
_SCT = TypeVar("_SCT", str_, bytes_)
_CharArray = chararray[Any, dtype[_SCT]]
-__all__: List[str]
+__all__: list[str]
# Comparison
@overload
diff --git a/numpy/core/einsumfunc.pyi b/numpy/core/einsumfunc.pyi
index ec34c3c92..24c6d3228 100644
--- a/numpy/core/einsumfunc.pyi
+++ b/numpy/core/einsumfunc.pyi
@@ -1,4 +1,4 @@
-from typing import List, TypeVar, Any, overload, Union, Tuple, Sequence, Literal
+from typing import TypeVar, Any, overload, Union, Sequence, Literal
from numpy import (
ndarray,
@@ -34,7 +34,7 @@ _OptimizeKind = None | bool | Literal["greedy", "optimal"] | Sequence[Any]
_CastingSafe = Literal["no", "equiv", "safe", "same_kind"]
_CastingUnsafe = Literal["unsafe"]
-__all__: List[str]
+__all__: list[str]
# TODO: Properly handle the `casting`-based combinatorics
# TODO: We need to evaluate the content `__subscripts` in order
@@ -140,4 +140,4 @@ def einsum_path(
/,
*operands: _ArrayLikeComplex_co,
optimize: _OptimizeKind = ...,
-) -> Tuple[List[Any], str]: ...
+) -> tuple[list[Any], str]: ...
diff --git a/numpy/core/fromnumeric.pyi b/numpy/core/fromnumeric.pyi
index 12847ae4f..591f9b3c0 100644
--- a/numpy/core/fromnumeric.pyi
+++ b/numpy/core/fromnumeric.pyi
@@ -1,5 +1,5 @@
import datetime as dt
-from typing import Union, Sequence, Tuple, Any, overload, TypeVar, Literal
+from typing import Union, Sequence, Any, overload, TypeVar, Literal
from numpy import (
ndarray,
@@ -203,7 +203,7 @@ def trace(
def ravel(a: ArrayLike, order: _OrderKACF = ...) -> ndarray: ...
-def nonzero(a: ArrayLike) -> Tuple[ndarray, ...]: ...
+def nonzero(a: ArrayLike) -> tuple[ndarray, ...]: ...
def shape(a: ArrayLike) -> _Shape: ...
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: ...
diff --git a/numpy/core/getlimits.pyi b/numpy/core/getlimits.pyi
index 66d062995..da5e3c23e 100644
--- a/numpy/core/getlimits.pyi
+++ b/numpy/core/getlimits.pyi
@@ -1,8 +1,6 @@
-from typing import List
-
from numpy import (
finfo as finfo,
iinfo as iinfo,
)
-__all__: List[str]
+__all__: list[str]
diff --git a/numpy/core/memmap.pyi b/numpy/core/memmap.pyi
index ba595bf1e..03c6b772d 100644
--- a/numpy/core/memmap.pyi
+++ b/numpy/core/memmap.pyi
@@ -1,5 +1,3 @@
-from typing import List
-
from numpy import memmap as memmap
-__all__: List[str]
+__all__: list[str]
diff --git a/numpy/core/multiarray.pyi b/numpy/core/multiarray.pyi
index b410ffe21..b8816bd26 100644
--- a/numpy/core/multiarray.pyi
+++ b/numpy/core/multiarray.pyi
@@ -9,11 +9,8 @@ from typing import (
Iterable,
overload,
TypeVar,
- List,
- Type,
Union,
Sequence,
- Tuple,
SupportsIndex,
final,
Final,
@@ -89,7 +86,7 @@ _ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
# Subscriptable subsets of `npt.DTypeLike` and `npt.ArrayLike`
_DTypeLike = Union[
dtype[_SCT],
- Type[_SCT],
+ type[_SCT],
_SupportsDType[dtype[_SCT]],
]
_ArrayLike = _FiniteNestedSequence[_SupportsArray[dtype[_SCT]]]
@@ -119,7 +116,7 @@ _RollKind = L[ # `raise` is deliberately excluded
"modifiedpreceding",
]
-__all__: List[str]
+__all__: list[str]
ALLOW_THREADS: Final[int] # 0 or 1 (system-specific)
BUFSIZE: L[8192]
@@ -283,26 +280,26 @@ def unravel_index( # type: ignore[misc]
indices: _IntLike_co,
shape: _ShapeLike,
order: _OrderCF = ...,
-) -> Tuple[intp, ...]: ...
+) -> tuple[intp, ...]: ...
@overload
def unravel_index(
indices: _ArrayLikeInt_co,
shape: _ShapeLike,
order: _OrderCF = ...,
-) -> Tuple[NDArray[intp], ...]: ...
+) -> tuple[NDArray[intp], ...]: ...
@overload
def ravel_multi_index( # type: ignore[misc]
multi_index: Sequence[_IntLike_co],
dims: Sequence[SupportsIndex],
- mode: _ModeKind | Tuple[_ModeKind, ...] = ...,
+ mode: _ModeKind | tuple[_ModeKind, ...] = ...,
order: _OrderCF = ...,
) -> intp: ...
@overload
def ravel_multi_index(
multi_index: Sequence[_ArrayLikeInt_co],
dims: Sequence[SupportsIndex],
- mode: _ModeKind | Tuple[_ModeKind, ...] = ...,
+ mode: _ModeKind | tuple[_ModeKind, ...] = ...,
order: _OrderCF = ...,
) -> NDArray[intp]: ...
@@ -367,7 +364,7 @@ def inner(
def where(
condition: ArrayLike,
/,
-) -> Tuple[NDArray[intp], ...]: ...
+) -> tuple[NDArray[intp], ...]: ...
@overload
def where(
condition: ArrayLike,
@@ -598,10 +595,10 @@ def asfortranarray(
like: ArrayLike = ...,
) -> NDArray[Any]: ...
-# In practice `List[Any]` is list with an int, int and a valid
+# In practice `list[Any]` is list with an int, int and a valid
# `np.seterrcall()` object
-def geterrobj() -> List[Any]: ...
-def seterrobj(errobj: List[Any], /) -> None: ...
+def geterrobj() -> list[Any]: ...
+def seterrobj(errobj: list[Any], /) -> None: ...
def promote_types(__type1: DTypeLike, __type2: DTypeLike) -> dtype[Any]: ...
@@ -810,7 +807,7 @@ def arange(
def datetime_data(
dtype: str | _DTypeLike[datetime64] | _DTypeLike[timedelta64], /,
-) -> Tuple[str, int]: ...
+) -> tuple[str, int]: ...
# The datetime functions perform unsafe casts to `datetime64[D]`,
# so a lot of different argument types are allowed here
@@ -1023,4 +1020,4 @@ def nested_iters(
order: _OrderKACF = ...,
casting: _CastingKind = ...,
buffersize: SupportsIndex = ...,
-) -> Tuple[nditer, ...]: ...
+) -> tuple[nditer, ...]: ...
diff --git a/numpy/core/numeric.pyi b/numpy/core/numeric.pyi
index d7ec30351..a8727b1ce 100644
--- a/numpy/core/numeric.pyi
+++ b/numpy/core/numeric.pyi
@@ -2,13 +2,10 @@ from typing import (
Any,
Union,
Sequence,
- Tuple,
Callable,
- List,
overload,
TypeVar,
Literal,
- Type,
SupportsAbs,
SupportsIndex,
NoReturn,
@@ -57,13 +54,13 @@ _ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_DTypeLike = Union[
dtype[_SCT],
- Type[_SCT],
+ type[_SCT],
_SupportsDType[dtype[_SCT]],
]
_ArrayLike = _FiniteNestedSequence[_SupportsArray[dtype[_SCT]]]
_CorrelateMode = Literal["valid", "same", "full"]
-__all__: List[str]
+__all__: list[str]
@overload
def zeros_like(
@@ -406,43 +403,43 @@ def outer(
def tensordot(
a: _ArrayLikeBool_co,
b: _ArrayLikeBool_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[bool_]: ...
@overload
def tensordot(
a: _ArrayLikeUInt_co,
b: _ArrayLikeUInt_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[unsignedinteger[Any]]: ...
@overload
def tensordot(
a: _ArrayLikeInt_co,
b: _ArrayLikeInt_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[signedinteger[Any]]: ...
@overload
def tensordot(
a: _ArrayLikeFloat_co,
b: _ArrayLikeFloat_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[floating[Any]]: ...
@overload
def tensordot(
a: _ArrayLikeComplex_co,
b: _ArrayLikeComplex_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[complexfloating[Any, Any]]: ...
@overload
def tensordot(
a: _ArrayLikeTD64_co,
b: _ArrayLikeTD64_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[timedelta64]: ...
@overload
def tensordot(
a: _ArrayLikeObject_co,
b: _ArrayLikeObject_co,
- axes: int | Tuple[_ShapeLike, _ShapeLike] = ...,
+ axes: int | tuple[_ShapeLike, _ShapeLike] = ...,
) -> NDArray[object_]: ...
@overload
@@ -528,15 +525,15 @@ def cross(
@overload
def indices(
dimensions: Sequence[int],
- dtype: Type[int] = ...,
+ dtype: type[int] = ...,
sparse: Literal[False] = ...,
) -> NDArray[int_]: ...
@overload
def indices(
dimensions: Sequence[int],
- dtype: Type[int] = ...,
+ dtype: type[int] = ...,
sparse: Literal[True] = ...,
-) -> Tuple[NDArray[int_], ...]: ...
+) -> tuple[NDArray[int_], ...]: ...
@overload
def indices(
dimensions: Sequence[int],
@@ -548,7 +545,7 @@ def indices(
dimensions: Sequence[int],
dtype: _DTypeLike[_SCT],
sparse: Literal[True],
-) -> Tuple[NDArray[_SCT], ...]: ...
+) -> tuple[NDArray[_SCT], ...]: ...
@overload
def indices(
dimensions: Sequence[int],
@@ -560,7 +557,7 @@ def indices(
dimensions: Sequence[int],
dtype: DTypeLike,
sparse: Literal[True],
-) -> Tuple[NDArray[Any], ...]: ...
+) -> tuple[NDArray[Any], ...]: ...
def fromfunction(
function: Callable[..., _T],
diff --git a/numpy/core/numerictypes.pyi b/numpy/core/numerictypes.pyi
index 1d3ff773b..1ad7dc7ce 100644
--- a/numpy/core/numerictypes.pyi
+++ b/numpy/core/numerictypes.pyi
@@ -2,14 +2,10 @@ import sys
import types
from typing import (
Literal as L,
- Type,
Union,
- Tuple,
overload,
Any,
TypeVar,
- Dict,
- List,
Iterable,
Protocol,
TypedDict,
@@ -57,7 +53,7 @@ _SCT = TypeVar("_SCT", bound=generic)
# A paramtrizable subset of `npt.DTypeLike`
_DTypeLike = Union[
- Type[_SCT],
+ type[_SCT],
dtype[_SCT],
_SupportsDType[dtype[_SCT]],
]
@@ -78,48 +74,48 @@ class _TypeCodes(TypedDict):
Datetime: L['Mm']
All: L['?bhilqpBHILQPefdgFDGSUVOMm']
-class _typedict(Dict[Type[generic], _T]):
+class _typedict(dict[type[generic], _T]):
def __getitem__(self, key: DTypeLike) -> _T: ...
if sys.version_info >= (3, 10):
_TypeTuple = Union[
- Type[Any],
+ type[Any],
types.UnionType,
- Tuple[Union[Type[Any], types.UnionType, Tuple[Any, ...]], ...],
+ tuple[Union[type[Any], types.UnionType, tuple[Any, ...]], ...],
]
else:
_TypeTuple = Union[
- Type[Any],
- Tuple[Union[Type[Any], Tuple[Any, ...]], ...],
+ type[Any],
+ tuple[Union[type[Any], tuple[Any, ...]], ...],
]
-__all__: List[str]
+__all__: list[str]
@overload
-def maximum_sctype(t: _DTypeLike[_SCT]) -> Type[_SCT]: ...
+def maximum_sctype(t: _DTypeLike[_SCT]) -> type[_SCT]: ...
@overload
-def maximum_sctype(t: DTypeLike) -> Type[Any]: ...
+def maximum_sctype(t: DTypeLike) -> type[Any]: ...
@overload
-def issctype(rep: dtype[Any] | Type[Any]) -> bool: ...
+def issctype(rep: dtype[Any] | type[Any]) -> bool: ...
@overload
def issctype(rep: object) -> L[False]: ...
@overload
-def obj2sctype(rep: _DTypeLike[_SCT], default: None = ...) -> None | Type[_SCT]: ...
+def obj2sctype(rep: _DTypeLike[_SCT], default: None = ...) -> None | type[_SCT]: ...
@overload
-def obj2sctype(rep: _DTypeLike[_SCT], default: _T) -> _T | Type[_SCT]: ...
+def obj2sctype(rep: _DTypeLike[_SCT], default: _T) -> _T | type[_SCT]: ...
@overload
-def obj2sctype(rep: DTypeLike, default: None = ...) -> None | Type[Any]: ...
+def obj2sctype(rep: DTypeLike, default: None = ...) -> None | type[Any]: ...
@overload
-def obj2sctype(rep: DTypeLike, default: _T) -> _T | Type[Any]: ...
+def obj2sctype(rep: DTypeLike, default: _T) -> _T | type[Any]: ...
@overload
def obj2sctype(rep: object, default: None = ...) -> None: ...
@overload
def obj2sctype(rep: object, default: _T) -> _T: ...
@overload
-def issubclass_(arg1: Type[Any], arg2: _TypeTuple) -> bool: ...
+def issubclass_(arg1: type[Any], arg2: _TypeTuple) -> bool: ...
@overload
def issubclass_(arg1: object, arg2: object) -> L[False]: ...
@@ -137,37 +133,37 @@ def find_common_type(
cast: _typedict[_CastFunc]
nbytes: _typedict[int]
typecodes: _TypeCodes
-ScalarType: Tuple[
- Type[int],
- Type[float],
- Type[complex],
- Type[int],
- Type[bool],
- Type[bytes],
- Type[str],
- Type[memoryview],
- Type[bool_],
- Type[csingle],
- Type[cdouble],
- Type[clongdouble],
- Type[half],
- Type[single],
- Type[double],
- Type[longdouble],
- Type[byte],
- Type[short],
- Type[intc],
- Type[int_],
- Type[longlong],
- Type[timedelta64],
- Type[datetime64],
- Type[object_],
- Type[bytes_],
- Type[str_],
- Type[ubyte],
- Type[ushort],
- Type[uintc],
- Type[uint],
- Type[ulonglong],
- Type[void],
+ScalarType: tuple[
+ type[int],
+ type[float],
+ type[complex],
+ type[int],
+ type[bool],
+ type[bytes],
+ type[str],
+ type[memoryview],
+ type[bool_],
+ type[csingle],
+ type[cdouble],
+ type[clongdouble],
+ type[half],
+ type[single],
+ type[double],
+ type[longdouble],
+ type[byte],
+ type[short],
+ type[intc],
+ type[int_],
+ type[longlong],
+ type[timedelta64],
+ type[datetime64],
+ type[object_],
+ type[bytes_],
+ type[str_],
+ type[ubyte],
+ type[ushort],
+ type[uintc],
+ type[uint],
+ type[ulonglong],
+ type[void],
]
diff --git a/numpy/core/records.pyi b/numpy/core/records.pyi
index 172bab3ee..1e837b492 100644
--- a/numpy/core/records.pyi
+++ b/numpy/core/records.pyi
@@ -1,12 +1,10 @@
import os
from typing import (
- List,
Sequence,
Any,
TypeVar,
Iterable,
overload,
- Tuple,
Protocol,
)
@@ -39,7 +37,7 @@ class _SupportsReadInto(Protocol):
def tell(self, /) -> int: ...
def readinto(self, buffer: memoryview, /) -> int: ...
-__all__: List[str]
+__all__: list[str]
@overload
def fromarrays(
@@ -67,7 +65,7 @@ def fromarrays(
@overload
def fromrecords(
- recList: _ArrayLikeVoid_co | Tuple[Any, ...] | _NestedSequence[Tuple[Any, ...]],
+ recList: _ArrayLikeVoid_co | tuple[Any, ...] | _NestedSequence[tuple[Any, ...]],
dtype: DTypeLike = ...,
shape: None | _ShapeLike = ...,
formats: None = ...,
@@ -78,7 +76,7 @@ def fromrecords(
) -> _RecArray[record]: ...
@overload
def fromrecords(
- recList: _ArrayLikeVoid_co | Tuple[Any, ...] | _NestedSequence[Tuple[Any, ...]],
+ recList: _ArrayLikeVoid_co | tuple[Any, ...] | _NestedSequence[tuple[Any, ...]],
dtype: None = ...,
shape: None | _ShapeLike = ...,
*,
diff --git a/numpy/core/shape_base.pyi b/numpy/core/shape_base.pyi
index 159ad2781..f0f0f6f56 100644
--- a/numpy/core/shape_base.pyi
+++ b/numpy/core/shape_base.pyi
@@ -1,4 +1,4 @@
-from typing import TypeVar, overload, List, Sequence, Any, SupportsIndex
+from typing import TypeVar, overload, Sequence, Any, SupportsIndex
from numpy import generic, dtype
from numpy.typing import ArrayLike, NDArray, _FiniteNestedSequence, _SupportsArray
@@ -8,28 +8,28 @@ _ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_ArrayLike = _FiniteNestedSequence[_SupportsArray[dtype[_SCT]]]
-__all__: List[str]
+__all__: list[str]
@overload
def atleast_1d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]: ...
@overload
def atleast_1d(arys: ArrayLike, /) -> NDArray[Any]: ...
@overload
-def atleast_1d(*arys: ArrayLike) -> List[NDArray[Any]]: ...
+def atleast_1d(*arys: ArrayLike) -> list[NDArray[Any]]: ...
@overload
def atleast_2d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]: ...
@overload
def atleast_2d(arys: ArrayLike, /) -> NDArray[Any]: ...
@overload
-def atleast_2d(*arys: ArrayLike) -> List[NDArray[Any]]: ...
+def atleast_2d(*arys: ArrayLike) -> list[NDArray[Any]]: ...
@overload
def atleast_3d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]: ...
@overload
def atleast_3d(arys: ArrayLike, /) -> NDArray[Any]: ...
@overload
-def atleast_3d(*arys: ArrayLike) -> List[NDArray[Any]]: ...
+def atleast_3d(*arys: ArrayLike) -> list[NDArray[Any]]: ...
@overload
def vstack(tup: Sequence[_ArrayLike[_SCT]]) -> NDArray[_SCT]: ...