Skip to content

Commit

Permalink
Fixup IdSet docstring (#54153)
Browse files Browse the repository at this point in the history
* `IdSet{T}` has values of type `T`, not `V`
* Test the example
* Properly format the example

(cherry picked from commit a84ed82)
  • Loading branch information
jakobnissen authored and KristofferC committed Apr 25, 2024
1 parent 9b5f3c9 commit 7e13db3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions base/idset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
IdSet()
IdSet{T}() constructs a set (see [`Set`](@ref)) using
`===` as equality with values of type `V`.
`===` as equality with values of type `T`.
In the example below, the values are all `isequal` so they get overwritten.
The `IdSet` compares by `===` so preserves the 3 different keys.
Examples
≡≡≡≡≡≡≡≡
In the example below, the values are all `isequal` so they get overwritten in the ordinary `Set`.
The `IdSet` compares by `===` and so preserves the 3 different values.
# Examples
```jldoctest; filter = r"\\n\\s*(1|1\\.0|true)"
julia> Set(Any[true, 1, 1.0])
Set{Any} with 1 element:
1.0
Expand All @@ -22,6 +21,7 @@ IdSet{Any} with 3 elements:
1.0
1
true
```
"""
mutable struct IdSet{K} <: AbstractSet{K}
list::Memory{Any}
Expand Down

0 comments on commit 7e13db3

Please sign in to comment.