You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Boolean values are incorrectly accepted by integer and float validators #258
The Response class uses _validate_non_negative_int() and _validate_non_negative_float() to validate integer and float parameters. However, these validators use isinstance(value, int) and isinstance(value, (float, int)).
Because bool is a subclass of int in Python, boolean values such as True and False pass these validations.
As a result, parameters that are expected to be integers or floats can incorrectly accept boolean values.
Steps to reproduce
Create a Response object with a boolean value for an integer parameter:
Response(top_k=True)
Create a Response object with a boolean value for a float parameter:
Activity