def union(self, other): if isinstance(other, BitSet): return self._logic(self.copy(), operator.__or__, other) b = self.copy() b.update(other) return b