Evaluatable
- class Evaluatable(expression: str, expected_type: Type[EvalT] | Callable[[Any], EvalT], *, file_name: str = '<string>')
An
Evaluatable
is an expression that can be evaluated witheval()
. These allow for the dynamic evaluation ofShapeQueryParameters
and other properties used during the execution ofShapeMachine
.When evaluated, a context can be provided that gets passed to the
globals()
parameter of theeval()
function.- Parameters:
expression – The expression to be evaluated.
expected_type – The expected output type of the expression. This can also be provided as a callable that maps the value outputted by
eval()
to the expected type.file_name – A file name used when compiling the expression, which can be helpful during error handling and bug fixing (see
compile()
).
Methods
Evaluate this
expression
.