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

Reminder: revise copy semantics in __array__ protocol implementations #16168

Open
neutrinoceros opened this issue Mar 6, 2024 · 0 comments
Open

Comments

@neutrinoceros
Copy link
Contributor

neutrinoceros commented Mar 6, 2024

#16142 introduced the copy argument to __array__ implementations, because numpy dev required it. However, this was only a small part of the PR and it may not have gotten the attention it needed.

In fact, the question has been asked upstream about how this argument should be implemented, see
numpy/numpy#25941
This discussion isn't concluded yet, but the ticket is currently triaged as part of the numpy 2.0 milestone, so I'd expect some consensus be reached by the time we see a stable release.

While we're on this, and if it doesn't turn out like a completely separate issue, we could also address this comment from @mhvk : #16142 (comment):

Separately, I'm actually not sure this implementation is correct, I think it should be return self._array.astype(dtype=dtype, copy=copy) but then the default would have to be False (which I think is fine).

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