bagof.validators.common
Common validators (any, union, etc.)
Classes
IsLiteral
IsTypeVar
IsAnnotated
Validator for Annotated.
Note
Annotated validators look for validators in the metadata of an annotated type hint and apply them in order (if they are composable).
Methods:
register
classmethod
Decorator to register a validator class for one or more
Annotated metadata hints (e.g. re.Pattern).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*hints
|
Unpack[tuple[Any]]
|
One or more metadata hints to register the validator class for. |
()
|
Returns:
| Type | Description |
|---|---|
ClassDecorator
|
A decorator that registers the validator class for the given metadata hints. |