3 <:call:>

<:call expr:>

Allows you to execute the Python expression in expr. Any object returned by the expression is ignored, and no output is included in your template. Think of this tag as being just like the <:val:> tag, except that <:call:> produces no output.

Examples:

<:call `function()`:>
<:call `module.function(var1, var2)`:>

You can also use this tag to do complex assignments that the <:set:> (see section 2.2, page ) tag cannot handle, such as assignments to items in a list or dictionary, or to attributes in an object. Here are some examples, with <:set:> used for the simple assignments to variable names:

<:set myList `[1,2,3,4]`:>
<:call `myList[0] = function()`:>
<:set myDict `{}`:>
<:call `myDict["foo"] = "Hey there"`:>
<:set myObj `newObject()`:>
<:call `myObj.someAttribute = 0`:>