diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-10-18 18:11:06 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-10-18 18:29:38 +0200 |
commit | 3952e8f1390629078fdb229236b3b1ce40140c32 (patch) | |
tree | 021f1e1cd0c713928cca948a8a2d51c6f9747324 /numpy/array_api | |
parent | f931a434839222bb00282a432d6d6a0c2c52eb7d (diff) | |
download | numpy-3952e8f1390629078fdb229236b3b1ce40140c32.tar.gz |
ENH: Change `SupportsDLPack` into a protocol
Diffstat (limited to 'numpy/array_api')
-rw-r--r-- | numpy/array_api/_typing.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/array_api/_typing.py b/numpy/array_api/_typing.py index 5e980b16f..dfa87b358 100644 --- a/numpy/array_api/_typing.py +++ b/numpy/array_api/_typing.py @@ -67,6 +67,8 @@ if TYPE_CHECKING or sys.version_info >= (3, 9): else: Dtype = dtype -SupportsDLPack = Any SupportsBufferProtocol = Any PyCapsule = Any + +class SupportsDLPack(Protocol): + def __dlpack__(self, /, *, stream: None = ...) -> PyCapsule: ... |