From 42c088b8b3e678edd19e5cb9ea54503e43624d06 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Fri, 10 Nov 2023 05:47:38 -0600 Subject: [PATCH] Fix errors in `sort` docstring (#52098) Two chagnes wrapped into one `Base.copymutable` => `Base.copymutable` & `collect` and `Base.copymutable` => `similar` & words. Followup for #52086 and #46104; also fixes #51932 (though we still may want to make `copymutable` public at some point) --------- Co-authored-by: Jameson Nash --- base/sort.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/sort.jl b/base/sort.jl index be5ed28b43ebe..f35add7a55b35 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -1474,7 +1474,8 @@ end Variant of [`sort!`](@ref) that returns a sorted copy of `v` leaving `v` itself unmodified. -Uses `Base.copymutable` to support immutable collections and iterables. +Returns something [`similar`](@ref) to `v` when `v` is an `AbstractArray` and uses +[`collect`](@ref) to support arbitrary non-`AbstractArray` iterables. !!! compat "Julia 1.10" `sort` of arbitrary iterables requires at least Julia 1.10.