def isfloat(x):
    """
    >>> isfloat(12)
    True
    >>> isfloat(12)
    True
    >>> isfloat('a')
    False
    >>> isfloat(float('nan'))
    True
    >>> isfloat(float('inf'))
    True
    """
    try: float(x)
    except: return False
    return True