def to_ipv6(self, ip_type='6-to-4'):
        """
        Convert (an IPv4) IP address to an IPv6 address.

        >>> ip = IP('192.0.2.42')
        >>> print(ip.to_ipv6())
        2002:c000:022a:0000:0000:0000:0000:0000

        >>> print(ip.to_ipv6('compat'))
        0000:0000:0000:0000:0000:0000:c000:022a

        >>> print(ip.to_ipv6('mapped'))
        0000:0000:0000:0000:0000:ffff:c000:022a
        """
        assert ip_type in ['6-to-4', 'compat', 'mapped'], 'Conversion ip_type not supported'
        if self.v == 4:
            if ip_type == '6-to-4':
                return IP(BASE_6TO4 | int(self) << 80, version=6)
            elif ip_type == 'compat':
                return IP(int(self), version=6)
            elif ip_type == 'mapped':
                return IP(0xffff << 32 | int(self), version=6)
        else:
            return self
Convert (an IPv4) IP address to an IPv6 address.

        >>> ip = IP('192.0.2.42')
        >>> print(ip.to_ipv6())
        2002:c000:022a:0000:0000:0000:0000:0000

        >>> print(ip.to_ipv6('compat'))
        0000:0000:0000:0000:0000:0000:c000:022a

        >>> print(ip.to_ipv6('mapped'))
        0000:0000:0000:0000:0000:ffff:c000:022a