AST function handler for an intermediate assignment in a statement block. The convention is that intermediate targets are named targets if they do not exist in the calling namespace and secondary outputs if they have been pre-allocated.
(self: NumExpr, node: ast.AST)
| 896 | # Note: these use 'self', which must be a NumExpr object |
| 897 | # ('self' is not a reserved keyword in Python) |
| 898 | def _assign(self: NumExpr, node: ast.AST) -> NumReg: |
| 899 | ''' |
| 900 | AST function handler for an intermediate assignment in a statement block. |
| 901 | The convention is that intermediate targets are named targets if they do not |
| 902 | exist in the calling namespace and secondary outputs if they have been |
| 903 | pre-allocated. |
| 904 | ''' |
| 905 | # print( '$ast.Assign' ) |
| 906 | # node.targets is a list; It must have a len=1 for NumExpr3 (i.e. no multiple returns) |
| 907 | # node.value is likely a BinOp, Call, Comparison, or BoolOp |
| 908 | if len(node.targets) != 1: |
| 909 | raise ValueError('NumExpr3 supports only singleton returns in assignments.') |
| 910 | |
| 911 | valueReg = _ASTAssembler[type(node.value)](self, node.value) |
| 912 | # Not populating self.assignTarget here, it's only needed for id'ing the |
| 913 | # output. |
| 914 | return _mutate(self, node.targets[0], valueReg) |
| 915 | |
| 916 | def _assign_last(self: NumExpr, node: ast.AST) -> NumReg: |
| 917 | ''' |
nothing calls this directly
no test coverage detected
searching dependent graphs…