-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Currently we can do length(a) == length(b) && issubset(a, b)
(which replicates ==(a::Set, b::Set)
), but this is not ideal.
Should we add a issetequal
function? Also, would we want to have sets containing the same elements be isequal
? If so, we could just widen the ==
signature for Set
to AbstractSet
, and similarly for hash
(this would be a huge performance regression for hash(::BitSet)
, but this would not be slower than for Set
, and speed is maybe not so important there).
And probably similarly for <
, ⊆
etc. Currently, there is some inconsistency: for example Set(1) ⊆ BitSet(1)
yields true
, but using ⊊
is a method error.
Even then, we could still have an issetequal
function for arrays and iterators.
I'm not sure how breaking a change this would be for 1.x. I can volunteer to make a PR in the next few days if needed.