drepr.utils.validator#
Classes
|
|
|
|
|
|
|
|
|
|
Exceptions
- exception InputError[source]#
Bases:
Exception- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class Validator[source]#
Bases:
object- static must_be_subset(parent: Set[Any], subset: Iterable[Any], setname: str, error_msg: str)[source]#
- class DictValidator(cls: str, is_optional: bool, **kwargs)[source]#
Bases:
SchemaValidator- REG_PT = re.compile('^int|str|float|any$')#
- REG_OPTIONAL = re.compile('^optional\\((.+)\\)$')#
- REG_LIST = re.compile('^list\\((.+)\\)$')#
- class AnyValidator(is_optional: bool)[source]#
Bases:
SchemaValidator- Parameters:
is_optional (bool) –
- class PrimitiveValidator(type_name: str, is_optional: bool)[source]#
Bases:
SchemaValidator
- class ListValidator(element_type: SchemaValidator, is_optional: bool)[source]#
Bases:
SchemaValidator- Parameters:
element_type (SchemaValidator) –
is_optional (bool) –