From 72a21ad39ca25fcd4703648d77c30825c3add10a Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 22 Jan 2025 18:18:45 -0800 Subject: [PATCH 1/2] fix: resolve conflicting exception guidance in `__dlpack__` Closes: https://github.com/data-apis/array-api/issues/831 --- src/array_api_stubs/_draft/array_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array_api_stubs/_draft/array_object.py b/src/array_api_stubs/_draft/array_object.py index 6d55b1eee..ee4c2a0e3 100644 --- a/src/array_api_stubs/_draft/array_object.py +++ b/src/array_api_stubs/_draft/array_object.py @@ -364,7 +364,7 @@ def __dlpack__( ``__dlpack__`` to return a capsule referencing an array whose underlying memory is accessible to the Python interpreter (represented by the ``kDLCPU`` enumerator in DLPack). If a copy must be made to enable this support but ``copy`` is set to ``False``, the - function must raise ``ValueError``. + function must raise ``BufferError``. Other device kinds will be considered for standardization in a future version of this API standard. From ab33f78a93e177d2afb890a0ecad0fff2a571400 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 22 Jan 2025 18:20:13 -0800 Subject: [PATCH 2/2] fix: backport changes to 2023.12 revision --- src/array_api_stubs/_2023_12/array_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array_api_stubs/_2023_12/array_object.py b/src/array_api_stubs/_2023_12/array_object.py index 5c0b10dd9..f5cc9bcee 100644 --- a/src/array_api_stubs/_2023_12/array_object.py +++ b/src/array_api_stubs/_2023_12/array_object.py @@ -364,7 +364,7 @@ def __dlpack__( ``__dlpack__`` to return a capsule referencing an array whose underlying memory is accessible to the Python interpreter (represented by the ``kDLCPU`` enumerator in DLPack). If a copy must be made to enable this support but ``copy`` is set to ``False``, the - function must raise ``ValueError``. + function must raise ``BufferError``. Other device kinds will be considered for standardization in a future version of this API standard.