curry.backends.py.graph.node module
- class curry.backends.py.graph.node.Node(info, *args, target=None, partial_info=None, **kwds)[source]
Bases:
objectA node in a Curry expression graph.
- info
- successors
- curry.backends.py.graph.node.new_node(cls, info, *args, target=None, partial=False)[source]
Create or rewrite a node.
If the keyword ‘target’ is supplied, then the object will be constructed there. This low-level function is intended for internal use only. To construct an expression, use
Interpreter.expr.- Parameters:
info – An instance of
CurryNodeInfoorInfoTableindicating the kind of node to create.*args – The successors. Each one should be a Node, built-in data object, or None. The value None is not a valid successor, but is used to construct cyclic expressions. These must be replaced before the object is used as an expression. The number of successors must equal info.arity, unless partial=True, in which case it should be strictly less.
target=None – Keyword-only argument. If not None, this specifies an existing Node object to rewrite.
partial=False – Indicates whether this constructs a partial application. If False, applying a function to too few arguments will cause
TypeErrorto be raised.
- Returns:
A
Node.