Skip to content

Commit

Permalink
deprecate unused initialized argument to sort. (#24424)
Browse files Browse the repository at this point in the history
extracted from #22388
  • Loading branch information
JeffBezanson authored Nov 1, 2017
1 parent 8dcc13e commit f92817a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,8 @@ end
@deprecate selectperm partialsortperm
@deprecate selectperm! partialsortperm!

# `initialized` keyword arg to `sort` is deprecated in sort.jl

@deprecate promote_noncircular promote false

import .Iterators.enumerate
Expand Down
7 changes: 5 additions & 2 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ end
## sorting multi-dimensional arrays ##

"""
sort(A, dim::Integer; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward, initialized::Bool=false)
sort(A, dim::Integer; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward)
Sort a multidimensional array `A` along the given dimension.
See [`sort!`](@ref) for a description of possible
Expand Down Expand Up @@ -864,7 +864,10 @@ function sort(A::AbstractArray, dim::Integer;
by=identity,
rev::Bool=false,
order::Ordering=Forward,
initialized::Bool=false)
initialized::Union{Bool,Void}=nothing)
if initialized !== nothing
Base.depwarn("`initialized` keyword argument is deprecated", :sort)
end
order = ord(lt,by,rev,order)
n = length(indices(A, dim))
if dim != 1
Expand Down

0 comments on commit f92817a

Please sign in to comment.