Skip to content

Commit 1a3fdc8

Browse files
committed
Rework docstrings for unique()
Remove any mention of ordering of the result, since for some custom array types an order can be more natural, useful or efficient than the order of appearance. Also fix the signature of the AbstractArray method, and add a mention of isequal() to it. Use imperative form.
1 parent 078835c commit 1a3fdc8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

base/multidimensional.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,11 +1263,11 @@ end
12631263
hash(x::Prehashed) = x.hash
12641264

12651265
"""
1266-
unique(itr[, dim])
1266+
unique(A::AbstractArray[, dim::Int])
12671267
1268-
Returns an array containing only the unique elements of the iterable `itr`, in
1269-
the order that the first of each set of equivalent elements originally appears.
1270-
If `dim` is specified, returns unique regions of the array `itr` along `dim`.
1268+
Return an array containing only the unique elements of array `A`, as determined by
1269+
[`isequal`](@ref). If `dim` is specified, returns unique regions of `A` along
1270+
dimension `dim`.
12711271
12721272
```jldoctest
12731273
julia> A = map(isodd, reshape(collect(1:8), (2,2,2)))

base/set.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const ⊆ = issubset
112112
"""
113113
unique(itr)
114114
115-
Returns an array containing one value from `itr` for each unique value,
115+
Return an array containing one value from `itr` for each unique value,
116116
as determined by [`isequal`](@ref).
117117
118118
```jldoctest

0 commit comments

Comments
 (0)