I've noticed that set.discard both reads and writes the set so Set.discard should raise an exception.