-
-
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
sort! docstring does not document order argument #22382
Comments
It seems to me that there are too many redundant options. Why is it not sufficient with just a single |
I guess there are cases in which you cannot reverse the sorting order without the |
But julia> x = randn(4);
julia> sort(x, lt = (x,y) -> isless(y,x)) == sort(x, rev = true) == sort(x, order=Base.Order.Reverse)
true
julia> x = [(rand(1:2), rand(1:2)) for i in 1:5]
5-element Array{Tuple{Int64,Int64},1}:
(1, 1)
(1, 1)
(2, 1)
(2, 1)
(2, 2)
julia> sort(x, lt = (x,y) -> isless(y,x)) == sort(x, rev = true) == sort(x, order=Base.Order.Reverse)
true |
@nalimilan Ah, yes, maybe I meant a single |
I agree |
In most cases, you can just do |
The order argument is kind of an implementation detail, so not documenting it was intentional. It will likely be removed in the next release. I suppose we could document it as a transient API in 0.6. |
The problem is that it appears in the docstring. FWIW, this wasn't the case in 0.6. Should we just remove it? |
Your call. |
I've filed #22388, applying the most radical fix. |
x-ref: #19295 |
Title says it all. That is particularly confusing is that "order" is mentioned twice, but in reference to
rev
, not toorder
.The text was updated successfully, but these errors were encountered: