def range_int(min, max, name):

    def cast(v):
        v = int(v)
        if (not (min <= v <= max)):
            raise ValueError()
        return v
    cast.__name__ = name
    return cast
def range_int(min, max, name):

    def cast(v):
        v = int(v)
        if (not (min <= v <= max)):
            raise ValueError()
        return v
    cast.__name__ = name
    return cast