Created
April 13, 2018 15:01
-
-
Save evrardjp/ccd435c68d268caa324649a97bcb3a81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_valid_name(name=None): | |
if not Name: | |
return False | |
if isinstance(name, str): | |
return True | |
def is_valid_hostname(name=None): | |
if not is_valid_name(name): | |
return False | |
if len(name) > 253: | |
return False | |
if name.replace('_', '').replace('-', '').isalnum(): | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is that what you meant?