def __isub__(self, other): if isinstance(other, (BaseMultiset, set, frozenset)): pass elif not isinstance(other, Set): return NotImplemented self.difference_update(other) return self