MAINT: cancel multifield copy->view and copy-by-position plans (alternate proposal) #11530
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a branch where I essentially reverted the major changes of #6053, since it causes some back-compat problems. Putting it here so we can compare, before deciding which way to go. See discussion in #11526. This revers the "multifield indexing returns a view" change, and the "multifield assignment occurs by-position instead of by-name" change.
#6053 wouldn't all be a loss though. This PR still keeps all the little fixes from that PR, and I also make multifield assignment consistent: Before #6053 you would get different behavior depending on whether you did array vs scalar assignment. In #6053 I chose to make all of numpy use "copy-by-position" for multifield assignment, in this PR everything is "copy-by-name". That means there is still a back-compat break in this PR for structured scalar assignment, but probably it has much less effect than #6053.
So if we go this route, at least numpy will be more self-consistent, while still being fairly back-compatible.
Also, at least in #6053 I have worked out how I think multifield indexing behavior should work, without all the quirks of current numpy. The day we implement the new standalone structured dtypes I suggest we use the behavior I worked out in #6053, if we decide to remove it here.
A lot of the code change here is just pasting back in things I removed in #6053.