@classmethod
def from_string(cls, string):
    """Return a new `.Hostmask` object parsed from *string*,
        according to the definition of ``<prefix>`` in
        :rfc:`1459#section-2.3.1`."""
    rest, _, host = string.partition('@')
    nick, _, user = rest.partition('!')
    return cls(nick, user or None, host or None)
