CompilerFilter
- class CompilerFilter
A
LazyImportsIteratorcompatible import filter evaluator.This class allows the filter to skip expensive Python marshalling during filter evaluation to improve performance in the common case.
Note that because the specification requires all filter expressions to be model-level evaluable, invocations of functions is an error.
Members defined in
CompilerFilter(5 members)
RWThe compiler used to evaluate filter expressions.
RWThe standard library context used in filter expression evaluation.
RWCallback used to propagate diagnostics from filter expression evaluation.
Evaluate conjunction of filter
conditionson an element target.
Construct a new filter evaluator with a given
compilerandlib. Attributes
- property compiler: syside.Compiler
The compiler used to evaluate filter expressions.
- property lib: syside.Stdlib
The standard library context used in filter expression evaluation.
This is required for reflection to be evaluated.
- property reporter: Callable[[syside.Element, syside.Diagnostic], None]
Callback used to propagate diagnostics from filter expression evaluation.
The signature is
(source: Element, diagnostic: Diagnostic) -> None, wheresourceis the element thediagnosticoriginates from.By default, this emits a
RuntimeWarningfor each diagnostic.
Methods
- __call__(arg0: syside.Element, arg1: Sequence[syside.Expression], /) bool
Evaluate conjunction of filter
conditionson an element target.
- __init__(compiler: syside.Compiler, lib: syside.Stdlib, reporter: Callable[[syside.Element, syside.Diagnostic], None] = ...) None
Construct a new filter evaluator with a given
compilerandlib.reporteris optional and is used to propagate any diagnostics from filter expression evaluation. By default, aRuntimeWarningis emitted on diagnostics.libis used to provide thecompilerwith standard library context required for metadata and reflection evaluation.