Why aren't Python sets hashable?
Generally, only immutable objects are hashable in Python. The immutable variant of set()
-- frozenset()
-- is hashable.
Because they're mutable.
If they were hashable, a hash could silently become "invalid", and that would pretty much make hashing pointless.