Skip to content

Commit a84ed82

Browse files
authored
Fixup IdSet docstring (#54153)
* `IdSet{T}` has values of type `T`, not `V` * Test the example * Properly format the example
1 parent 033abb4 commit a84ed82

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

base/idset.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
IdSet()
66
77
IdSet{T}() constructs a set (see [`Set`](@ref)) using
8-
`===` as equality with values of type `V`.
8+
`===` as equality with values of type `T`.
99
10-
In the example below, the values are all `isequal` so they get overwritten.
11-
The `IdSet` compares by `===` so preserves the 3 different keys.
12-
13-
Examples
14-
≡≡≡≡≡≡≡≡
10+
In the example below, the values are all `isequal` so they get overwritten in the ordinary `Set`.
11+
The `IdSet` compares by `===` and so preserves the 3 different values.
1512
13+
# Examples
14+
```jldoctest; filter = r"\\n\\s*(1|1\\.0|true)"
1615
julia> Set(Any[true, 1, 1.0])
1716
Set{Any} with 1 element:
1817
1.0
@@ -22,6 +21,7 @@ IdSet{Any} with 3 elements:
2221
1.0
2322
1
2423
true
24+
```
2525
"""
2626
mutable struct IdSet{K} <: AbstractSet{K}
2727
list::Memory{Any}

0 commit comments

Comments
 (0)