From 08053b2600f4b93575d8057238861219a1a57edc Mon Sep 17 00:00:00 2001 From: Bas van Beek <43369155+BvB93@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:33:11 +0100 Subject: STY: Replace `Optional` with the `|` operator --- numpy/core/_internal.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/_internal.pyi') diff --git a/numpy/core/_internal.pyi b/numpy/core/_internal.pyi index f4bfd770f..51b2a87dd 100644 --- a/numpy/core/_internal.pyi +++ b/numpy/core/_internal.pyi @@ -1,4 +1,4 @@ -from typing import Any, TypeVar, Type, overload, Optional, Generic +from typing import Any, TypeVar, Type, overload, Generic import ctypes as ct from numpy import ndarray @@ -6,7 +6,7 @@ from numpy.ctypeslib import c_intp _CastT = TypeVar("_CastT", bound=ct._CanCastTo) # Copied from `ctypes.cast` _CT = TypeVar("_CT", bound=ct._CData) -_PT = TypeVar("_PT", bound=Optional[int]) +_PT = TypeVar("_PT", bound=None | int) # TODO: Let the likes of `shape_as` and `strides_as` return `None` # for 0D arrays once we've got shape-support -- cgit v1.2.1