Set and Dict functions, such as issetequal use the hash function to determine equality and not isequal. The fallback implementation of hash doesn't work properly for SPDX datatypes because they are nearly all mutable structs and the hash of a generic mutable struct returns a different value for each instantiation, unlike an immutable struct.
Implement a custom hash function and it should solve this issue. Remember to write tests to verify this.
Set and Dict functions, such as
issetequal
use thehash
function to determine equality and notisequal
. The fallback implementation ofhash
doesn't work properly for SPDX datatypes because they are nearly all mutable structs and the hash of a generic mutable struct returns a different value for each instantiation, unlike an immutable struct.Implement a custom
hash
function and it should solve this issue. Remember to write tests to verify this.