(hostname)
return _IP_ADDRESS_REGEX.match(hostname) is not None
Detects whether the hostname given is an IPv4 or IPv6 address.
    Also detects IPv6 addresses with Zone IDs.

    :param str hostname: Hostname to examine.
    :return: True if the hostname is an IP address, False otherwise.
Detects whether the hostname given is an IPv4 or IPv6 address.
    Also detects IPv6 addresses with Zone IDs.
Detects whether the hostname given is an IPv4 or IPv6 address . Also detects IPv6 addresses with Zone IDs .
def is_ipaddress(hostname):
    """Detects whether the hostname given is an IPv4 or IPv6 address.
    Also detects IPv6 addresses with Zone IDs.

    :param str hostname: Hostname to examine.
    :return: True if the hostname is an IP address, False otherwise.
    """
    if six.PY3 and isinstance(hostname, bytes):
        # IDN A-label bytes are ASCII compatible.
        hostname = hostname.decode('ascii')
    return _IP_ADDRESS_REGEX.match(hostname) is not None
def is_ipaddress ( hostname ) : if six . PY3 and isinstance ( hostname , bytes ) : # IDN A-label bytes are ASCII compatible. hostname = hostname . decode ( 'ascii' ) return _IP_ADDRESS_REGEX . match ( hostname ) is not None