array-api-tests icon indicating copy to clipboard operation
array-api-tests copied to clipboard

asarray() copy flag and buffer protocol inputs are not sufficiently tested

Open asmeurer opened this issue 4 months ago • 0 comments

The asarray test seems to only test the copy flag for array inputs. But it should also work for Python built-in (scalar or sequence) and buffer protocol inputs. copy=False should always error for Python built-ins, and it should always work for buffer protocol.

Actually, buffer protocol inputs for asarray don't seem to be tested either. A simple way to test this would be to use array objects from the Python standard library array module (as confusing as that is). Or we could use the new Python buffer types, but those are Python 3.12-only.

See also https://github.com/data-apis/array-api-strict/pull/15

asmeurer avatar Mar 08 '24 00:03 asmeurer