Skip to content
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

Document the role of missing in PartialQuickSort and deprecate PartialQuickSort(::Integer) #47297

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ struct AdaptiveSortAlg <: Algorithm end
Indicate that a sorting function should use the partial quick sort algorithm.

Partial quick sort finds and sorts the elements that would end up in positions
`lo:hi` using [`QuickSort`](@ref).
`lo:hi` using [`QuickSort`](@ref). Missing bounds are treated as `begin` and `end`.

Characteristics:
* *stable*: preserves the ordering of elements which compare equal
Expand All @@ -434,8 +434,8 @@ struct PartialQuickSort{L<:Union{Integer,Missing}, H<:Union{Integer,Missing}} <:
lo::L
hi::H
end
PartialQuickSort(k::Integer) = PartialQuickSort(missing, k)
PartialQuickSort(k::OrdinalRange) = PartialQuickSort(first(k), last(k))
@deprecate PartialQuickSort(k::Integer) PartialQuickSort(missing, k)
Copy link
Member

@petvana petvana Oct 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't use @deprecate before, but it seems it should be placed into base/deprecated.jl.


"""
InsertionSort
Expand Down