-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Remove unsafe initialized=true option in sortperm! #47979
Conversation
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
@nanosoldier |
Your package evaluation job has completed - no new issues were detected. A full report can be found here. |
Removing a documented keyword seems like it is more than "technically" breaking. Maybe we can keep the keyword but just not document it? Or document it as deprecated? |
Agreed. As per the OP:
Concretely, |
Might be good to add a NEWS item? |
(wow; that took a lot of tries)
The reason we had
initialized=true
as an option was for performance reasons, but the possible performance savings are negligible:This is technically breaking because it changes the behavior of
sortperm!([2, 2], [7, 12]; initialized=true)
which previously returned[2, 2]
and will now return[1, 2]
.However, behavior when
initialized=true
andix
is not a permutation ofLinearIndices(v)
is currently undefined (explicitly undefined forpartialsortperm!
, simply not mentioned forsortperm!
) and I don't think anyone depends it, so I think this is a valid candidate for the "minor changes" exception.With this PR we still accept the option for compatibility reasons, but ignore it and don't document it. The current behavior is now the same as prior behavior with
initialized=false
or unspecified.Fixes #47977