def intersection_update(self, other):
        """
        Removes intervals from self unless they also exist in other.
        """
        ivs = list(self)
        for iv in ivs:
            if iv not in other:
                self.remove(iv)
def intersection_update ( self , other ) : ivs = list ( self ) for iv in ivs : if iv not in other : self . remove ( iv )
Removes intervals from self unless they also exist in other.