-
Notifications
You must be signed in to change notification settings - Fork 51
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
Reconsider copy
parameter values for asarray
function
#721
Comments
Thanks for the idea @mtsokol. My first thoughts:
|
I am in agreement with Ralf. I don't think it makes sense to add string variants, and I am not convinced that NumPy should do so either, as such an extension creates multiple ways to do the same thing and thus encourages portability concerns. Additionally, we try to ensure kwargs are consistent across specification APIs. Another API having a |
Hi!
During yesterday's NumPy Triage Call we had a discussion about
copy
keyword for theasarray
function, namelyNone/False/True
choice for possible values.The conclusion was that
asarray(x, copy=None)
doesn't convey the message of "make a copy only if needed", and could be replaced with something more expressive.We came up with other possibilities, like string values:
asarray(x, copy="always")
asarray(x, copy="ifneeded")
asarray(x, copy="never")
My question is: Would it make sense to move from None/bool values for
copy
keyword to string values in the Array API?Each library can then use and interpret None/bool as they wish, and only adhere to Array API with new string values that can be passed for library agnostic code.
The text was updated successfully, but these errors were encountered: