'Replace aliases with new ones.
Args:
new_aliases (str or list): Either a ;-separated string
or a list of aliases. These aliases will replace the
existing ones, if any.
Notes:
This is necessary to use to make sure the optimization
caches are properly updated as well.'

def set_aliases(self, new_aliases):

    if isinstance(new_aliases, basestring):
        new_aliases = new_aliases.split(';')
    aliases = (str(alias).strip().lower() for alias in make_iter(new_aliases))
    self.aliases = list(set((alias for alias in aliases if (alias != self.key))))
    self._optimize()
