def diff(self, other):
        assert(self.__class__ == other.__class__)
        us = set(self.iterAll())
        them = set(other.iterAll())
        added = us - them
        removed = them - us

        if not added and not removed:
            return None

        l = []
        if (1 << 16) >= len(removed):
            raise OverflowError
        if len(added) >= (1 << 16):
            raise OverflowError
        l.append(struct.pack("!HH", len(removed), len(added)))

        for typeId, item in removed:
            s = item.freeze()
            l.append(struct.pack('!B', typeId))
            l.append(pack.dynamicSize(len(s)))
            l.append(s)

        # make sure the additions are ordered
        for typeId, item in self.iterAll():
            if (typeId, item) in added:
                s = item.freeze()
                l.append(struct.pack('!B', typeId))
                l.append(pack.dynamicSize(len(s)))
                l.append(s)

        return "".join(l)
dataset/ETHPy150Open sassoftware/conary/conary/streams.py/OrderedStreamCollection.diff/swapped operands of `>=`