pg.mutfun.Function

Accessible via pg.mutfun.Function.

class Function(name, body, args=[])[source]

Bases: pg.mutfun.SymbolDefinition

A function that contains a list of instructions.

Methods:

compile()

Compiles current function.

evaluate(context)

Evaluates current instruction with variable dictionary.

prune()

Prune useless instructions.

python_repr([block_indent])

Returns a Python code representation of current instruction.

compile()[source]

Compiles current function.

evaluate(context)[source]

Evaluates current instruction with variable dictionary.

Return type:

Any

prune()[source]

Prune useless instructions.

python_repr(block_indent=0)[source]

Returns a Python code representation of current instruction.

Return type:

str