'Gets the set of changed bytes between `self` and `other`.
:type other:    SimPagedMemory
:returns:       A set of differing bytes.'

def __changed_bytes(self, other):

    if (self._page_size != other._page_size):
        raise SimMemoryError('SimPagedMemory    page    sizes    differ.    This    is    asking    for    disaster.')
    our_pages = set(self._pages.keys())
    their_pages = set(other._pages.keys())
    their_additions = (their_pages - our_pages)
    our_additions = (our_pages - their_pages)
    common_pages = (our_pages & their_pages)
    candidates = set()
    for p in their_additions:
        candidates.update(other._pages[p].keys())
    for p in our_additions:
        candidates.update(self._pages[p].keys())
    for p in common_pages:
        our_page = self._pages[p]
        their_page = other._pages[p]
        if (our_page is their_page):
            continue
        our_keys = set(our_page.keys())
        their_keys = set(their_page.keys())
        changes = (((our_keys - their_keys) | (their_keys - our_keys)) | {i for i in (our_keys & their_keys) if (our_page.load_mo(self.state, i) is not their_page.load_mo(self.state, i))})
        candidates.update(changes)
    differences = set()
    for c in candidates:
        if ((c not in self) and (c in other)):
            differences.add(c)
        elif ((c in self) and (c not in other)):
            differences.add(c)
        else:
            if (type(self[c]) is not SimMemoryObject):
                self[c] = SimMemoryObject(self.state.se.BVV(ord(self[c]), 8), c)
            if (type(other[c]) is not SimMemoryObject):
                other[c] = SimMemoryObject(self.state.se.BVV(ord(other[c]), 8), c)
            if ((c in self) and (self[c] != other[c])):
                self_byte = self[c].bytes_at(c, 1)
                other_byte = other[c].bytes_at(c, 1)
                if (self_byte is not other_byte):
                    differences.add(c)
            else:
                pass
    return differences
