Checks if value is a boolean, number or string.

def isconstant(args, quoted=False):
    """Checks if value is a boolean, number or string."""
    check = lambda c: isbool(c) or isnumber(c) or isstring(c, quoted)
    if isinstance(args, list):
        return all(map(check, args))
    else:
        return check(args)