Expression Compiler

class zope.tales.tales.ExpressionEngine[source]

Expression compiler, an implementation of zope.tal.interfaces.ITALExpressionCompiler.

An instance of this class keeps a mutable collection of expression type handlers. It can compile expression strings by delegating to these handlers. It can provide an expression engine, which is capable of holding state and evaluating compiled expressions.

By default, this object does not know how to compile any expression types. See zope.tales.engine.Engine and zope.tales.engine.DefaultEngine() for pre-configured instances supporting the standard expression types.

zope.tales.engine.DefaultEngine()[source]

Create and return an instance of ExpressionEngine (an implementation of zope.tal.interfaces.ITALExpressionCompiler) with the following expression types registered:

string

StringExpr

python

PythonExpr

not

NotExpr

defer

DeferExpr

lazy

LazyExpr

modules

SimpleModuleImporter

In addition, the default path expressions (standard, path, exists and nocall), all implemented by PathExpr, are registered.

zope.tales.engine.Engine

An instance of the default engine (DefaultEngine()) that can be used for simple shared cases