diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-12-21 16:33:11 +0100 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-12-22 00:08:03 +0100 |
commit | 08053b2600f4b93575d8057238861219a1a57edc (patch) | |
tree | 9edef76d944cfcbdbb4bcf41516b3cf15f3a9a86 /numpy/core/_internal.pyi | |
parent | 509d3ab421142905482592337ea2407bacb351ac (diff) | |
download | numpy-08053b2600f4b93575d8057238861219a1a57edc.tar.gz |
STY: Replace `Optional` with the `|` operator
Diffstat (limited to 'numpy/core/_internal.pyi')
-rw-r--r-- | numpy/core/_internal.pyi | 4 |
1 files changed, 2 insertions, 2 deletions
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 |