Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
asmeurer opened this issue Mar 8, 2024 · 0 comments

Comments

@asmeurer
Copy link
Member

asmeurer commented Mar 8, 2024

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 data-apis/array-api-strict#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants