def check_type(x, validtypes):
    """
    Checks the type of x versus a list of valid types.  If type(x) matches
    any member of the list, then return True, otherwise return False
    """
    type_ok = False
    tmp = type(x)
    for i in validtypes:
        if tmp == i:
            type_ok = True
    return type_ok