bagof.validators.misc
Miscellaneous validators (forbidden values, etc.).
Attributes
IsNotOneOfValidator
module-attribute
IsNotOneOfValidator = IsNotOneOf
Deprecated alias for IsNotOneOf.
Every other validator is named IsXxx; the suffix was dropped for
consistency.
Classes
IsNotOneOf
Validator for values not in a forbidden set.
A value is forbidden only when it matches by type as well as
value: forbidding 1 does not forbid True, even though the two
compare equal.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
forbidden
|
Iterable[T]
|
The forbidden values. Need not be hashable. |
required |
hint
|
Any
|
The type hint to validate against. If not provided, the default hint for the class is used. |
UNSET
|
compose
|
bool
|
Whether to compose this validator with others, when they are
found in |
False
|