The issetequal docstring says that issetequal(a, b) is equivalent to a ⊆ b && b ⊆ a, but I found this isn’t the case when there are duplicate elements. In v1.0.0:
julia> a = [1,2,3];
julia> b = [1,1,2,3];
julia> a ⊆ b && b ⊆ a
true
julia> issetequal(a, b)
false
The name of the function, issetequal(a,b) kind of indicates that a and b should be sets. Indeed,
julia> a = Set([1,2,3])
Set([2, 3, 1])
julia> b = Set([1,1,2,3])
Set([2, 3, 1])
julia> issetequal(a,b)
true
So an alternative question is: should the function respond with true/false with other argument types, e.g., vectors (in original question), tuples, etc.? Or should the function give an error message if the arguments are not sets?
There are quite a few set operations that work correctly for non-sets, eg setdiff, union, intersect. So it’s not unreasonable to expect this to work correctly as well, especially given that it doesn’t throw a no method error.
Perhaps. But do you then say that issetequal(a,b) == isequal(Set(a),Set(b)) (or rather: should be like that)? If so, perhaps issetequal() is not an essential function?