From d6febf42c5ec63eed6da1d65ba008588445cf598 Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Fri, 19 Apr 2024 15:16:11 +0200 Subject: [PATCH 1/3] Fixup IdSet docstring * `IdSet{T}` has values of type `T`, not `V` * Test the example * Properly format the example --- base/idset.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/idset.jl b/base/idset.jl index 23f9ca009af0c..fbb1c552af8ec 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"^\\s*([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} From 6ddbf24b4b3afb3bb9a6856ee907c9349267da41 Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Fri, 19 Apr 2024 15:54:32 +0200 Subject: [PATCH 2/3] Update base/idset.jl Co-authored-by: Lilith Orion Hafner --- base/idset.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/idset.jl b/base/idset.jl index fbb1c552af8ec..e94137cd02402 100644 --- a/base/idset.jl +++ b/base/idset.jl @@ -11,7 +11,7 @@ In the example below, the values are all `isequal` so they get overwritten in th The `IdSet` compares by `===` and so preserves the 3 different values. # Examples -```jldoctest; filter = r"^\\s*([1\\.0]+|true)" +```jldoctest; filter = r"^\\s*(1|1\\.0|true)" julia> Set(Any[true, 1, 1.0]) Set{Any} with 1 element: 1.0 From 357a69b0f15ebda605d817e656c44c9fb6cd84a7 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sat, 20 Apr 2024 00:56:01 +0000 Subject: [PATCH 3/3] Update base/idset.jl --- base/idset.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/idset.jl b/base/idset.jl index e94137cd02402..c46d49968ff73 100644 --- a/base/idset.jl +++ b/base/idset.jl @@ -11,7 +11,7 @@ In the example below, the values are all `isequal` so they get overwritten in th The `IdSet` compares by `===` and so preserves the 3 different values. # Examples -```jldoctest; filter = r"^\\s*(1|1\\.0|true)" +```jldoctest; filter = r"\\n\\s*(1|1\\.0|true)" julia> Set(Any[true, 1, 1.0]) Set{Any} with 1 element: 1.0