Open SyxP opened 1 year ago
This is documenting rather than fixing bad behavior IMO.
For any type T
, x::T
and y::T
should not have x == y
unless x
and y
agree on all aspects of their public API. Since order is part of the public API of Ordered
containers, they should not be ==(::T, ::T)
unless they agree on order.
I agree, I don't like how this works. But as we had a discussion on Slack, this is actually how someone might prefer the behaviour to be.
I make no judgement on whether this is the "correct" behaviour. But as of now this is what is inside the library, and I document it to prevent confusion. I will close the PR if there is another successfully merged PR augmenting the behaviour.
I don't think ordered_set is part of this repository. I believe that it is in the JuliaCollections/OrderedCollections.jl repository.
1) Fixed incorrect example code in
OrderedSet
(Note that this code doesn't run as the various irrational numbers are not defined. Previously it was just a method error.)2) Added clarification on equality. The behaviour was raised as a point of confusion in a Slack thread. I just documented the current existing behaviour.