-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
API: Make a.flat.__array__
return a copy when a
non-contiguous.
#9447
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
Conversation
* If underlying array is readonly, then we make the output array readonly | ||
* and updateifcopy does not apply. | ||
* | ||
* Changed for 1.14, 07/21/2017. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: 2017-07-21
. Let's make searching for dates easy on ourselves
Ignoring the temporary readonly flag, will |
d84fdba
to
6de4bf1
Compare
Fixed. |
Yes. |
Shouldn't this be |
replaces pull request #9249, correct? |
a.flat.__array__
return a copy when a non-contiguous.a.flat.__array__
return a copy when a
non-contiguous.
a.flat.__array__
return a copy when a
non-contiguous.a.flat.__array__
return a copy when a
non-contiguous.
@eric-wieser This isn't a warning, it is an outright change of behavior. We are going to gamble that few, if any, folks will be affected, but if so we want to know. If this doesn't work we might fall back to a warning. |
I realize - but if we're going to do an outright change in 1.14, we still have time to stick a warning into 1.13.2 that it's about to happen, so we should |
The only reason for 1.13.2 is to build wheels against 3.6.2, otherwise the 1.13 release cycle is done unless a grievous error turns up. I don't want people to be bothered with new error/warning messages. We have already decided not to issue a warning in any case. |
Previously an UPDATEIFCOPY array was returned when `a` was non-contiguous and writeable. Exposing that type of array does not work well with PyPy as there is no refcount, and hence the writeback never occurs. The copy in this case is set to non-writable to expose cases where a writeback was expected. At some future time the copy will be made writable. See numpygh-7054 for a discussion of this issue. It is not expected that this change will affect many people.
6de4bf1
to
5a5f1a3
Compare
doc/release/1.14.0-notes.rst
Outdated
@@ -50,6 +56,16 @@ Build System Changes | |||
Compatibility notes | |||
=================== | |||
|
|||
``a.flat.__array__()`` returns non-writeable arrays when ``a`` is non-contiguos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling: contiguos → contiguous
Otherwise LGTM. Feel free to merge after fixing the typo :-) |
Oh wait a sec, I can just fix the typo myself. The future! |
Not while using a commit prefix, it seems ;) |
@eric-wieser: I squashed it out when merging anyway :-P |
Would be nice if the github UI would indicate whether a squash merge was used |
…s. (numpy#9447) * API: Make ``a.flat.__array__`` return copy if ``a`` non-contiguous. Previously an UPDATEIFCOPY array was returned when `a` was non-contiguous and writeable. Exposing that type of array does not work well with PyPy as there is no refcount, and hence the writeback never occurs. The copy in this case is set to non-writable to expose cases where a writeback was expected. At some future time the copy will be made writable. See numpygh-7054 for a discussion of this issue. It is not expected that this change will affect many people.
Previously an UPDATEIFCOPY array was returned when
a
was non-contiguousand writeable. Exposing that type of array does not work well with PyPy
as it doesn't do refcounting, and hence the writeback never occurs. The copy that
is now returned instead is set to non-writable to expose cases where a writeback
was expected. At some future date the copy will be made writable. See
gh-7054 for a discussion of this issue.