lazyeval module

class src.core.lazyeval.LazyEval(expression, engine)

Bases: object

A class for lazy evaluation of expressions.

The LazyEval class is used to defer the evaluation of an expression until its value is actually needed. This can be useful in scenarios where evaluating the expression is expensive and might not be required unless certain conditions are met. The class ensures that the expression is evaluated only once, caching the result for subsequent accesses.

expression

The expression to be lazily evaluated.

Type:

any

engine

The engine used to evaluate the expression.

Type:

ExecutionEngine

value

The evaluated value of the expression, initialized to None.

Type:

any

evaluated

A flag indicating whether the expression has been evaluated, initialized to False.

Type:

bool

evaluate()

Evaluates the expression if it hasn’t been evaluated yet.

Returns: The evaluated value of the expression.