From 7e13db3bc102896d0f2187197b6ab6a3c540213e Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Sat, 20 Apr 2024 16:53:38 +0200 Subject: [PATCH] Fixup IdSet docstring (#54153) * `IdSet{T}` has values of type `T`, not `V` * Test the example * Properly format the example (cherry picked from commit a84ed8256a9fb2617526543e47cea9ec4526b7fa) --- base/idset.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/idset.jl b/base/idset.jl index 23f9ca009af0c..c46d49968ff73 100644 --- a/base/idset.jl +++ b/base/idset.jl @@ -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 @@ -22,6 +21,7 @@ IdSet{Any} with 3 elements: 1.0 1 true +``` """ mutable struct IdSet{K} <: AbstractSet{K} list::Memory{Any}