jinja2.nodes.Expr.as_const¶
-
Expr.
as_const
(eval_ctx=None)[source]¶ Return the value of the expression as constant or raise
Impossible
if this was not possible.An
EvalContext
can be provided, if none is given a default context is created which requires the nodes to have an attached environment.Changed in version 2.4: the eval_ctx parameter was added.