One check. run(value, ast, options) gives None or the issue;
annotations describe it (expected, message, title, ...);
an aborted filter stops the checks after it when it fails.
Attributes#
| Attribute | Type | Description |
|---|---|---|
run | Callable[[T_contra, AST, ParseOptions], Issue | None] | |
annotations | Annotations | None = None | |
aborted | bool = False |
Functions#
__init__#
__init__(run, annotations=None, aborted=False) -> None| Parameter | Type | Description |
|---|---|---|
run | Callable[[T_contra, AST, ParseOptions], Issue | None] | |
annotations | Annotations | None = None | |
aborted | bool = False |
annotate#
annotate(**annotations) -> Filter[T_contra]This filter with annotations merged over its own.
| Parameter | Type | Description |
|---|---|---|
annotations | object = {} |
Returns Filter[T_contra]
def annotate(self, /, **annotations: object) -> Filter[T_contra]:
"""This filter with ``annotations`` merged over its own."""
return replace(self, annotations={**(self.annotations or {}), **annotations})abort#
abort() -> Filter[T_contra]This filter, stopping the checks after it when it fails.
Returns Filter[T_contra]
def abort(self) -> Filter[T_contra]:
"""This filter, stopping the checks after it when it fails."""
return replace(self, aborted=True)and_#
and_[T](other, **annotations) -> FilterGroup[T]This check and other as one group (Effect's and).
| Parameter | Type | Description |
|---|---|---|
other | Check[T] | |
annotations | object = {} |
Returns FilterGroup[T]
def and_[T](self: Filter[T], other: Check[T], /, **annotations: object) -> FilterGroup[T]:
"""This check and ``other`` as one group (Effect's ``and``)."""
return FilterGroup((self, other), annotations or None)