def constant(expr):
    """
    testing if an expression is numeric

    :param expr: any expression to be tested
    :return: true if numeric, false if not numeric
    """
    try:
        float(expr)
        return True
    except ValueError:
        return False