'Return the difference of two sets as a new Set.
(I.e. all elements that are in this set and not in the other.)'

def difference(self, other):

    result = self.__class__()
    data = result._data
    try:
        otherdata = other._data
    except AttributeError:
        otherdata = Set(other)._data
    value = True
    for elt in ifilterfalse(otherdata.__contains__, self):
        data[elt] = value
    return result
