diff options
| author | Aaron Meurer <asmeurer@gmail.com> | 2021-03-09 17:20:56 -0700 |
|---|---|---|
| committer | Aaron Meurer <asmeurer@gmail.com> | 2021-03-09 17:20:56 -0700 |
| commit | 8671a368cff459d5a00c5b43d330d084e2f6ed3d (patch) | |
| tree | 706c435bba207c23e9cdbb0452698e343abd6345 /numpy/_array_api | |
| parent | 48a2d8c39bb58611307122f55da6f0e99cf86086 (diff) | |
| download | numpy-8671a368cff459d5a00c5b43d330d084e2f6ed3d.tar.gz | |
Use the array API types for the array API type annotations
Diffstat (limited to 'numpy/_array_api')
| -rw-r--r-- | numpy/_array_api/_types.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/_array_api/_types.py b/numpy/_array_api/_types.py index 3800b7156..32d03e2a7 100644 --- a/numpy/_array_api/_types.py +++ b/numpy/_array_api/_types.py @@ -11,12 +11,13 @@ __all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', from typing import Literal, Optional, Tuple, Union, TypeVar -import numpy as np +from . import (ndarray, int8, int16, int32, int64, uint8, uint16, uint32, + uint64, float32, float64) -array = np.ndarray +array = ndarray device = TypeVar('device') -dtype = Literal[np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, - np.uint32, np.uint64, np.float32, np.float64] +dtype = Literal[int8, int16, int32, int64, uint8, uint16, + uint32, uint64, float32, float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule') |
