<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, other):
 """ Update themeables with those from `other` This method takes care of inserting the `themeable` into the underlying dictionary. Before doing the insertion, any existing themeables that will be affected by a new from `other` will either be merged or removed. This makes sure that a general themeable of type :class:`text` can be added to override an existing specific one of type :class:`axis_text_x`. """

        for new in other.values():
            new_key = new.__class__.__name__

            # 1st in the mro is self, the
            # last 2 are (themeable, object)
            for child in new.__class__.mro()[1:-2]:
                child_key = child.__name__
                try:
                    self[child_key].merge(new)
                except KeyError:
                    pass
                except ValueError:
                    # Blank child is will be overridden
                    del self[child_key]
            try:
                self[new_key].merge(new)
            except (KeyError, ValueError):
                # Themeable type is new or
                # could not merge blank element.
                self[new_key] = new