def convertable(obj, func):
    """
    Returns True if obj can be converted by func without an error.
    """

    try:
        func(obj)
        return True
    except ValueError:
        return False