Erase items with the specified flags and insert the new items from
        the other sentence instead.

def update(self, new: 'Sentence', flags: Flags):
        """
        Erase items with the specified flags and insert the new items from
        the other sentence instead.
        """

        items = [i for i in self.items if i.flags != flags]
        items.extend(new.items)
        self.items = items