Login
Back to bricks list
Introduction Version

IntValidator

Validator class

This validator allows validating serialized (or deserialized) integer parameter values.

Usage: Let validator = IntValidator(), then * validator.validate('3') -> 3 * validator.validate(3) -> 3) * validator.validate(3.0) -> 3 * validator.validate('false') -> ValueError * validator.validate('true') -> ValueError * validator.validate('foo') -> ValueError

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

Parameters:
NameTypeDefault valueDescription
min_valuefloat -inf
max_valuefloat inf
include_minbool True
include_maxbool True
allowed_valuesList
SET_TYPE
Parameters:
NameTypeDefault valueDescription
type_Union
VALIDATE

Valitates a value.

Parameters:
NameTypeDefault valueDescription
valueUnion The value to validate an instance of `bool`, `int`, `float`, `str` or serilaizable `list`, `dict`
Return type:
Any