|
| t.Any | as_const (self, t.Optional[EvalContext] eval_ctx=None) |
| |
| bool | can_assign (self) |
| |
|
None | __init__ (self, *t.Any fields, **t.Any attributes) |
| |
| t.Iterator[t.Tuple[str, t.Any]] | iter_fields (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None) |
| |
| t.Iterator["Node"] | iter_child_nodes (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None) |
| |
| t.Optional[_NodeBound] | find (self, t.Type[_NodeBound] node_type) |
| |
| t.Iterator[_NodeBound] | find_all (self, t.Union[t.Type[_NodeBound], t.Tuple[t.Type[_NodeBound],...]] node_type) |
| |
| "Node" | set_ctx (self, str ctx) |
| |
| "Node" | set_lineno (self, int lineno, bool override=False) |
| |
| "Node" | set_environment (self, "Environment" environment) |
| |
|
bool | __eq__ (self, t.Any other) |
| |
|
str | __repr__ (self) |
| |
|
str | dump (self) |
| |
|
| __new__ (mcs, name, bases, d) |
| |
Baseclass for all expressions.
| t.Any jinja2.nodes.Expr.as_const |
( |
|
self, |
|
|
t.Optional[EvalContext] |
eval_ctx = None |
|
) |
| |
Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environment.
.. versionchanged:: 2.4
the `eval_ctx` parameter was added.
Reimplemented in jinja2.nodes.BinExpr, jinja2.nodes.UnaryExpr, jinja2.nodes.Const, jinja2.nodes.TemplateData, jinja2.nodes.Tuple, jinja2.nodes.List, jinja2.nodes.Dict, jinja2.nodes.CondExpr, jinja2.nodes._FilterTestCommon, jinja2.nodes.Filter, jinja2.nodes.Getitem, jinja2.nodes.Getattr, jinja2.nodes.Slice, jinja2.nodes.Concat, jinja2.nodes.Compare, jinja2.nodes.And, jinja2.nodes.Or, jinja2.nodes.MarkSafe, and jinja2.nodes.MarkSafeIfAutoescape.