BUG,DEP: Fix writeable flag setting for arrays without base#13463
BUG,DEP: Fix writeable flag setting for arrays without base#13463mattip merged 1 commit intonumpy:masterfrom
Conversation
|
I may add a fix for Mattis PR here probably (with a test), but if someone reviews it before that, will just open a new PR afterwards. |
There was a problem hiding this comment.
Needs a comment what is the purpose of this function, it is a bit obscure at first glance.
numpy/core/src/multiarray/methods.c
Outdated
There was a problem hiding this comment.
The new deprecation should appear in the release notes
aa88116 to
bba44ee
Compare
|
Add some docs and release notes (only changes). |
doc/release/1.17.0-notes.rst
Outdated
There was a problem hiding this comment.
Maybe clearer to state the reason:
"When an array is created from the C-API to wrap a pointer to data, the only indication we have of the read-write nature of the data is the writeable flag set during creation. It is dangerous to force the flag to writeable. In the future it will not be possible to switch the writeable flag to True.
There was a problem hiding this comment.
Yeah, that is better, added a "from python" at the end.
This also deprecates setting a non-writeable array to writeable if that array does not own its data (and has no base object to check if the memory may be writeable). (Deprecation on Python side only) Closes numpygh-481
|
Thanks @seberg, this also closes the second-oldest open issue! |
This also deprecates setting a non-writeable array to writeable if
that array does not own its data (and has no base object to check if
the memory may be writeable). (Deprecation on Python side only)
Closes gh-481
Well, this was probably a waste of time, thought it would be quicker, but should be reasonable in any case...