additional extension file to substitute all of the field defined in substitutes. Substituted node is needed for 'flattening' a node with respect to a particular node, because the usual `infer` will give us `uninferable` result. This is useful in solving the conditional equation with respect to the argument or any other node. e.g. >>> context.node_ignore.add(nodes.Arg) >>> def foo(x, y): ... z = x + y ... f = z * 2 ... if f == 2: pass # `f` can be expressed as `(x + y) * 2` Substitutes will only happens if following conditions are met - `self` node is uninferable - the mentioned field is inferable A copy of `self` node will be created to replace the substituted field. This is to avoid changing the node.
Function | flatten |
Construct expression in relative to the argument of any function/method. Only target argument that is not `self` :return: |
Function | register |
Undocumented |
Function | unregister |
Undocumented |
Constant | MANAGER |
Undocumented |
Function | _infer |
Undocumented |
Function | _infer |
bool op will convert (a and b and c) to z3.If(bool(a), a, z3.If(bool(b), c)) This assume that `a`, `b`, `c` must have the same sort. |
Variable | _infer |
Undocumented |
Construct expression in relative to the argument of any function/method. Only target argument that is not `self` :return:
Parameters | |
node:nodes.Arg | Undocumented |
@handle_z3_exceptions
def _infer_bool_op_prm_field(node, context): (source)
bool op will convert (a and b and c) to z3.If(bool(a), a, z3.If(bool(b), c)) This assume that `a`, `b`, `c` must have the same sort.
Parameters | |
node:nodes.BoolOp | Undocumented |
context | Undocumented |