import fnmatch


def fnmatchList(val, patlist):
    """Compare value to pattern list.
    """
    if patlist is None:
        return True
    for pat in patlist:
        if fnmatch.fnmatchcase(val, pat):
            return True
    return False