We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For assignment using __setitem__, numpy is calling the __array__ method on the value with a copy=True. This can be seen by running the code example.
__setitem__
__array__
copy=True
import numpy class MyThing(object): def __array__(self, dtype=None, copy=None): print(f"MyThing.__array__(dtype={dtype}, copy={copy})") return numpy.ones((5, 5)) u = numpy.zeros((5, 5)) v = MyThing() u[...] = v
No response
2.2.1 3.13.1 | packaged by conda-forge | (main, Dec 5 2024, 21:09:18) [Clang 18.1.8 ]
This additional copy on a common operation will be extremely inefficient.
The text was updated successfully, but these errors were encountered:
The issue description says you're using an old NumPy version - do you still the same behavior on the most recent release?
Sorry, something went wrong.
Sorry, yes, I just tested for 2.2.1 (and update my report). Thanks.
dtype("c") > dtype("S") and dtype("c") < dtype("S")
True
No branches or pull requests
Describe the issue:
For assignment using
__setitem__
, numpy is calling the__array__
method on the value with acopy=True
. This can be seen by running the code example.Reproduce the code example:
Error message:
No response
Python and NumPy Versions:
2.2.1
3.13.1 | packaged by conda-forge | (main, Dec 5 2024, 21:09:18) [Clang 18.1.8 ]
Runtime Environment:
No response
Context for the issue:
This additional copy on a common operation will be extremely inefficient.
The text was updated successfully, but these errors were encountered: