Closed NicholasWMRitchie closed 4 years ago
It would be very helpful to implement isequal and hash in a fast efficient manner since in many uses Element instances are used as keys.
For example: Base.hash(elm::Element) = hash(elm.number) Base.isequal(elm1::Element,elm2::Element) = elm1.number==elm2.number
Base.hash(elm::Element) = hash(elm.number)
Base.isequal(elm1::Element,elm2::Element) = elm1.number==elm2.number
and maybe also
Base.isless(elm1::Element, elm2::Element) = elm1.number < elm2.number
A PR would be welcome.
Can someone close this, since it was done in https://github.com/JuliaPhysics/PeriodicTable.jl/pull/28?
It would be very helpful to implement isequal and hash in a fast efficient manner since in many uses Element instances are used as keys.
For example:
Base.hash(elm::Element) = hash(elm.number)
Base.isequal(elm1::Element,elm2::Element) = elm1.number==elm2.number
and maybe also
Base.isless(elm1::Element, elm2::Element) = elm1.number < elm2.number