(self, other, replacements=None, top=None)
return self
Merge another KeyedRegion into this KeyedRegion, but mark all variables with different values as TOP.

        :param other:   The other instance to merge with.
        :param replacements:
        :return:        self
Merge another KeyedRegion into this KeyedRegion, but mark all variables with different values as TOP.
Merge another KeyedRegion into this KeyedRegion but mark all variables with different values as TOP .
def merge_to_top(self, other, replacements=None, top=None):
        """
        Merge another KeyedRegion into this KeyedRegion, but mark all variables with different values as TOP.

        :param other:   The other instance to merge with.
        :param replacements:
        :return:        self
        """

        for _, item in other._storage.items():  # type: RegionObject
            for so in item.stored_objects:  # type: StoredObject
                if replacements and so.obj in replacements:
                    so = StoredObject(so.start, replacements[so.obj], so.size)
                self._object_mapping[so.obj_id] = so
                self.__store(so, overwrite=False, merge_to_top=True, top=top)

        return self
def merge_to_top ( self , other , replacements = None , top = None ) : for _ , item in other . _storage . items ( ) : # type: RegionObject for so in item . stored_objects : # type: StoredObject if replacements and so . obj in replacements : so = StoredObject ( so . start , replacements [ so . obj ] , so . size ) self . _object_mapping [ so . obj_id ] = so self . __store ( so , overwrite = False , merge_to_top = True , top = top ) return self