validators
Answer validators.
Classes¶
ExprValidator
¶
ExprValidator(expr: str = '')
A callable that will validate input by rendering an expression.
Functions¶
__call__
¶
__call__(value: T) -> T
Validate the input.
PARAMETER | DESCRIPTION |
---|---|
value
|
The value to validate.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
The value if the expression returns nothing. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the expression returns a value. The message of the ValueError is the rendered expression. |