Closed
Description
As I mentioned on Discourse, the issetequal
docstring says that issetequal(a, b)
is equivalent to a ⊆ b && b ⊆ a
, but this isn't the case when there are duplicate elements:
julia> versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
julia> a = [1,2,3];
julia> b = [1,1,2,3];
julia> a ⊆ b && b ⊆ a
true
julia> issetequal(a, b)
false
This is because the implementation assumes no duplicate elements:
issetequal(l, r) = length(l) == length(r) && l ⊆ r