diff options
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r-- | astroid/rebuilder.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index 5d4ffcff..e77c2c28 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -14,7 +14,6 @@ import sys import _ast import astroid -from astroid import astpeephole from astroid import nodes @@ -120,7 +119,6 @@ class TreeRebuilder(object): self._import_from_nodes = [] self._delayed_assattr = [] self._visit_meths = {} - self._peepholer = astpeephole.ASTPeepholeOptimizer() def visit_module(self, node, modname, modpath, package): """visit a Module node by returning a fresh instance of it""" @@ -252,23 +250,6 @@ class TreeRebuilder(object): def visit_binop(self, node, parent): """visit a BinOp node by returning a fresh instance of it""" - if isinstance(node.left, _ast.BinOp) and self._manager.optimize_ast: - # Optimize BinOp operations in order to remove - # redundant recursion. For instance, if the - # following code is parsed in order to obtain - # its ast, then the rebuilder will fail with an - # infinite recursion, the same will happen with the - # inference engine as well. There's no need to hold - # so many objects for the BinOp if they can be reduced - # to something else (also, the optimization - # might handle only Const binops, which isn't a big - # problem for the correctness of the program). - # - # ("a" + "b" + # one thousand more + "c") - optimized = self._peepholer.optimize_binop(node, parent) - if optimized: - return optimized - newnode = nodes.BinOp(_BIN_OP_CLASSES[type(node.op)], node.lineno, node.col_offset, parent) newnode.postinit(self.visit(node.left, newnode), |