Skip to content

Reminder: revise copy semantics in __array__ protocol implementations #16168

Open

Description

@neutrinoceros

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions