def double(x):
    try:
        float(x)
    except (ValueError, TypeError):
        raise ValueError(('%r is not a valid double' % x))
    else:
        return x
def double(x):
    try:
        float(x)
    except (ValueError, TypeError):
        raise ValueError(('%r is not a valid double' % x))
    else:
        return x