summaryrefslogtreecommitdiff
path: root/numpy/typing
diff options
context:
space:
mode:
authorBas van Beek <43369155+BvB93@users.noreply.github.com>2021-12-21 16:33:11 +0100
committerBas van Beek <43369155+BvB93@users.noreply.github.com>2021-12-22 00:08:03 +0100
commit08053b2600f4b93575d8057238861219a1a57edc (patch)
tree9edef76d944cfcbdbb4bcf41516b3cf15f3a9a86 /numpy/typing
parent509d3ab421142905482592337ea2407bacb351ac (diff)
downloadnumpy-08053b2600f4b93575d8057238861219a1a57edc.tar.gz
STY: Replace `Optional` with the `|` operator
Diffstat (limited to 'numpy/typing')
-rw-r--r--numpy/typing/tests/data/pass/array_like.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/typing/tests/data/pass/array_like.py b/numpy/typing/tests/data/pass/array_like.py
index 5bd2fda20..4e9f8dded 100644
--- a/numpy/typing/tests/data/pass/array_like.py
+++ b/numpy/typing/tests/data/pass/array_like.py
@@ -1,4 +1,6 @@
-from typing import Any, Optional
+from __future__ import annotations
+
+from typing import Any
import numpy as np
from numpy.typing import ArrayLike, _SupportsArray
@@ -18,7 +20,7 @@ x12: ArrayLike = memoryview(b'foo')
class A:
- def __array__(self, dtype: Optional[np.dtype] = None) -> np.ndarray:
+ def __array__(self, dtype: None | np.dtype[Any] = None) -> np.ndarray:
return np.array([1, 2, 3])