if pattern equals '*' or pattern starts with '.' or pattern equals host, and only if:
match = ( pattern == '*' or pattern . startswith ( '.' ) and ( host . endswith ( pattern ) or host == pattern [ 1 : ] ) or pattern == host )