(v)
return all(hostname_part_re.match(part) for part in v.split('.'))
Validates a hostname.
Validates a hostname.
Validates a hostname .
def Hostname(v):
    """ Validates a hostname. """
    if len(v) > 255:
        return False
    # Strips one dot from the right if applicable.
    v = v[:-1] if v.endswith('.') else v
    # Validates each part of the hostname.
    return all(hostname_part_re.match(part) for part in v.split('.'))
def Hostname ( v ) : if len ( v ) > 255 : return False # Strips one dot from the right if applicable. v = v [ : - 1 ] if v . endswith ( '.' ) else v # Validates each part of the hostname. return all ( hostname_part_re . match ( part ) for part in v . split ( '.' ) )