def __isub__()

in geneve/utils/solution_space.py [0:0]


    def __isub__(self, other):
        if not isinstance(other, Strings):
            other = Strings(other)
        if other.__set == everything():
            self.__set = set()
            self.__exclude = None
            return self
        if not self.__set or not other.__set:
            return self
        if self.__set == everything():
            if self.__exclude is None:
                self.__exclude = Strings({})
            self.__exclude |= other
            return self
        if self.__exclude is None:
            self.__exclude = Strings({})
        sub = set()
        excl = set()
        for s in self.__set:
            for o in other.__set:
                if s == o:
                    sub.add(s)
                elif o[1] and fnmatchcase(s[0].lower(), o[0].lower()):  # o has wildcards
                    sub.add(s)
                elif s[1] and fnmatchcase(o[0].lower(), s[0].lower()):  # s has wildcards
                    excl.add(o[0])
                elif s[1] and o[1]:  # both have wildcards
                    excl.add(o[0])
        self.__set -= sub
        self.__exclude |= excl
        return self