From 5264dc220dc208e533bdbdcafa9f4f06ddb04aab Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Mon, 24 Jan 2022 17:17:35 +0100 Subject: MAINT: Create the `_DTypeLike` type-alias in `numpy.typing` Represents a subset of `npt.DTypeLike` that can be parametrized w.r.t. `np.generic` --- numpy/lib/function_base.pyi | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'numpy/lib/function_base.pyi') diff --git a/numpy/lib/function_base.pyi b/numpy/lib/function_base.pyi index 6e2f886cf..d99672169 100644 --- a/numpy/lib/function_base.pyi +++ b/numpy/lib/function_base.pyi @@ -2,7 +2,6 @@ import sys from collections.abc import Sequence, Iterator, Callable, Iterable from typing import ( Literal as L, - Union, Any, TypeVar, overload, @@ -38,7 +37,7 @@ from numpy.typing import ( DTypeLike, _ShapeLike, _ScalarLike_co, - _SupportsDType, + _DTypeLike, _FiniteNestedSequence, _SupportsArray, _ArrayLikeInt_co, @@ -69,11 +68,6 @@ _ArrayType = TypeVar("_ArrayType", bound=NDArray[Any]) _2Tuple = tuple[_T, _T] _ArrayLike = _FiniteNestedSequence[_SupportsArray[dtype[_SCT]]] -_DTypeLike = Union[ - dtype[_SCT], - type[_SCT], - _SupportsDType[dtype[_SCT]], -] class _TrimZerosSequence(Protocol[_T_co]): def __len__(self) -> int: ... -- cgit v1.2.1