Do constant folding.
(self, node, eval_ctx=None)
| 33 | self.environment = environment |
| 34 | |
| 35 | def fold(self, node, eval_ctx=None): |
| 36 | """Do constant folding.""" |
| 37 | node = self.generic_visit(node) |
| 38 | try: |
| 39 | return nodes.Const.from_untrusted(node.as_const(eval_ctx), |
| 40 | lineno=node.lineno, |
| 41 | environment=self.environment) |
| 42 | except nodes.Impossible: |
| 43 | return node |
| 44 | |
| 45 | visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \ |
| 46 | visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \ |
nothing calls this directly
no test coverage detected