summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-10-18 18:11:06 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-10-18 18:29:38 +0200
commit3952e8f1390629078fdb229236b3b1ce40140c32 (patch)
tree021f1e1cd0c713928cca948a8a2d51c6f9747324 /numpy
parentf931a434839222bb00282a432d6d6a0c2c52eb7d (diff)
downloadnumpy-3952e8f1390629078fdb229236b3b1ce40140c32.tar.gz
ENH: Change `SupportsDLPack` into a protocol
Diffstat (limited to 'numpy')
-rw-r--r--numpy/array_api/_typing.py4
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: ...