def is_number(val):
    """Check if a value is a number by attempting to cast to ``float``.
    
    Args:
        val: Value to check.
    
    Returns:
        True if the value was successfully cast to ``float``; False otherwise.
    """
    try:
        float(val)
        return True
    except (ValueError, TypeError):
        return False