笨鸟编程-零基础入门Pyhton教程

 找回密码
 立即注册

扩展

发布者: 笨鸟自学网



classjinja2.nodes.Expr

Baseclass for all expressions.

Node type:Node
as_const(eval_ctx=None)

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.

can_assign()

Check if it’s possible to assign something to this node.

classjinja2.nodes.BinExpr(leftright)

Baseclass for all binary expressions.

Node type:Expr
classjinja2.nodes.Add(leftright)

Add the left to the right node.

Node type:BinExpr
classjinja2.nodes.And(leftright)

Short circuited AND.

Node type:BinExpr
classjinja2.nodes.Div(leftright)

Divides the left by the right node.

Node type:BinExpr
classjinja2.nodes.FloorDiv(leftright)

Divides the left by the right node and truncates conver the result into an integer by truncating.

Node type:BinExpr
classjinja2.nodes.Mod(leftright)

Left modulo right.

Node type:BinExpr
classjinja2.nodes.Mul(leftright)

Multiplies the left with the right node.

Node type:BinExpr
classjinja2.nodes.Or(leftright)

Short circuited OR.

Node type:BinExpr
classjinja2.nodes.Pow(leftright)

Left to the power of right.

Node type:BinExpr
classjinja2.nodes.Sub(leftright)

Subtract the right from the left node.

Node type:BinExpr
classjinja2.nodes.Call(nodeargskwargsdyn_argsdyn_kwargs)

Calls an expression. args is a list of arguments, kwargs a list of keyword arguments (list of Keyword nodes), and dyn_args and dyn_kwargs has to be either None or a node that is used as node for dynamic positional (*args) or keyword (**kwargs) arguments.

Node type:Expr
classjinja2.nodes.Compare(exprops)

Compares an expression with some other expressions. ops must be a list of Operands.

Node type:Expr
classjinja2.nodes.Concat(nodes)

Concatenates the list of expressions provided after converting them to unicode.

Node type:Expr
classjinja2.nodes.CondExpr(testexpr1expr2)

A conditional expression (inline if expression). ({{ foo if bar else baz }})

上一篇:模板设计者文档下一篇:集成

Archiver|手机版|笨鸟自学网 ( 粤ICP备20019910号 )

GMT+8, 2024-10-18 19:28 , Processed in 0.076228 second(s), 17 queries .

© 2001-2020