module documentation

Compiles nodes from the parser into Python code.
Constant F Undocumented
Variable operators Undocumented
Class ​Code​Generator No class docstring; 0/1 property, 0/25 instance variable, 0/12 class variable, 35/91 methods, 1/1 static method, 0/1 class documented
Class ​Compiler​Exit Raised if the compiler encountered a situation where it just doesn't make sense to further process the code. Any block that raises such an exception is not further processed.
Class ​Dependency​Finder​Visitor A visitor that collects filter and test calls.
Class ​Frame Holds compile time information for us.
Class ​Macro​Ref Undocumented
Class ​Undeclared​Name​Visitor A visitor that checks if a name is accessed without being declared. This is different from the frame visitor as it will not stop at closure frames.
Class ​Visitor​Exit Exception used by the UndeclaredNameVisitor to signal a stop.
Function ​_make​_binop Undocumented
Function ​_make​_unop Undocumented
Function find​_undeclared Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.
Function generate Generate the python source for a node tree.
Function has​_safe​_repr Does the node have a safe representation?
Function optimizeconst Undocumented
F =

Undocumented

Value
t.TypeVar('F',
          bound=t.Callable[..., t.Any])
operators: dict[str, str] =

Undocumented

def _make_binop(op):

Undocumented

Parameters
op:strUndocumented
Returns
t.Callable[[CodeGenerator, nodes.BinExpr, Frame], None]Undocumented
def _make_unop(op):

Undocumented

Parameters
op:strUndocumented
Returns
t.Callable[[CodeGenerator, nodes.UnaryExpr, Frame], None]Undocumented
def find_undeclared(nodes, names):
Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.
Parameters
nodes:t.Iterable[nodes.Node]Undocumented
names:t.Iterable[str]Undocumented
Returns
t.Set[str]Undocumented
def generate(node, environment, name, filename, stream=None, defer_init=False, optimized=True):
Generate the python source for a node tree.
Parameters
node:nodes.TemplateUndocumented
environment:EnvironmentUndocumented
name:t.Optional[str]Undocumented
filename:t.Optional[str]Undocumented
stream:t.Optional[t.TextIO]Undocumented
defer​_init:boolUndocumented
optimized:boolUndocumented
Returns
t.Optional[str]Undocumented
def has_safe_repr(value):
Does the node have a safe representation?
Parameters
value:t.AnyUndocumented
Returns
boolUndocumented
def optimizeconst(f):

Undocumented

Parameters
f:FUndocumented
Returns
FUndocumented