def parse_prefix(prefix):
    """ Take the prefix of an IRC message and split it up into its main parts
    as defined by :rfc:`2812#section-2.3.1`, section 2.3.1 which shows it 
    consisting of a server name or nick name, the user, and the host. This 
    function returns a 3-part tuple in the form of ``(nick, user, host)``. 
    If user and host aren't present in the prefix, they will be equal 
    to ``None``.
        
        >>> message = ":nickname!myuser@myhost.net PRIVMSG #gerty :Hello!"
        >>> prefix, cmd, params = parse_line(message)
        >>> parse_prefix(prefix)
        ('nickname', 'myuser', 'myhost.net')
    """
    if prefix is None:
        return None, None, None
    if '@' in prefix:
        prefix, host = prefix.split('@', 1)
    else:
        host = None
    if '!' in prefix:
        nick, user = prefix.split('!', 1)
    else:
        nick = prefix
        user = None
    return nick, user, host
