Login
Back to bricks list
Introduction Version

Validator

Base validator class Base validator allows validating serialized (or deserialized) parameter values according to a type.

Usage: This class should not be used as it, but rather use to implement validator subclasses. It provides the construction :meth:from_specs to create usable basic validators.

:property type: The expected type of the value :type type: type

Functions

__INIT__

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

Parameters:
NameTypeDefault valueDescription
type_Literal
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