Skip to content

Commit 21ad159

Browse files
committed
uniquify the docstring of unique(itr)
1 parent a32071d commit 21ad159

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

base/multidimensional.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,9 +1298,16 @@ hash(x::Prehashed) = x.hash
12981298
12991299
Returns an array containing only the unique elements of the iterable `itr`, in
13001300
the order that the first of each set of equivalent elements originally appears.
1301+
The unicity is determined by [`isequal`](@ref).
13011302
If `dim` is specified, returns unique regions of the array `itr` along `dim`.
13021303
13031304
```jldoctest
1305+
julia> unique([1, 2, 6, 2])
1306+
3-element Array{Int64,1}:
1307+
1
1308+
2
1309+
6
1310+
13041311
julia> A = map(isodd, reshape(collect(1:8), (2,2,2)))
13051312
2×2×2 Array{Bool,3}:
13061313
[:, :, 1] =

base/set.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,6 @@ const ⊆ = issubset
120120
(l::Set, r::Set) = !(l, r)
121121
(l::Set, r::Set) = <(r, l)
122122

123-
"""
124-
unique(itr)
125-
126-
Returns an array containing one value from `itr` for each unique value,
127-
as determined by [`isequal`](@ref).
128-
129-
```jldoctest
130-
julia> unique([1; 2; 2; 6])
131-
3-element Array{Int64,1}:
132-
1
133-
2
134-
6
135-
```
136-
"""
137123
function unique(itr)
138124
T = _default_eltype(typeof(itr))
139125
out = Vector{T}()

0 commit comments

Comments
 (0)