Cottonwood-Technology / ValidX

Fast, powerful, and flexible validator with sane syntax.
BSD 2-Clause "Simplified" License
20 stars 4 forks source link

OverFlowError('cannot convert float infinity to integer') #14

Closed Lorenzo-ITA closed 1 year ago

Lorenzo-ITA commented 1 year ago

validation for integer raise OverFlowError if value is np.inf

numbers.py > Int > __call

Class Int(v.Validator)
...
    def __call__(self, value, __context=None):
...
           try:
              value = int(value)
           except (TypeError, ValueError):
               raise v.exc.InvalidTypeError(expected=int, actual=type(value))

if value = np.inf

value = int(value) raise OverFlowError that is not catched.

Maybe it should be be included in the exception catched?