From adbafb64febfa9ff79e7d5e31600c826fe3b307e Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 27 May 2010 19:58:16 +0200 Subject: [PATCH] cleanup --- Cython/Compiler/Optimize.py | 21 --------------------- tests/run/inlined_generator_expressions.pyx | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 00c69c34..f0c79389 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1287,27 +1287,6 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform): append_node.target = dictcomp return dictcomp - - - arg = pos_args[0] - if isinstance(arg, ExprNodes.ComprehensionNode) and \ - isinstance(arg.target, (ExprNodes.ListNode, - ExprNodes.SetNode)): - append_node = arg.append - if isinstance(append_node.expr, (ExprNodes.TupleNode, ExprNodes.ListNode)) and \ - len(append_node.expr.args) == 2: - key_node, value_node = append_node.expr.args - target_node = ExprNodes.DictNode( - pos=arg.target.pos, key_value_pairs=[]) - new_append_node = ExprNodes.DictComprehensionAppendNode( - append_node.pos, target=target_node, - key_expr=key_node, value_expr=value_node) - arg.target = target_node - arg.type = target_node.type - replace_in = Visitor.RecursiveNodeReplacer(append_node, new_append_node) - return replace_in(arg) - return node - # specific handlers for general call nodes def _handle_general_function_dict(self, node, pos_args, kwargs): diff --git a/tests/run/inlined_generator_expressions.pyx b/tests/run/inlined_generator_expressions.pyx index 9bc9430c..b2843f75 100644 --- a/tests/run/inlined_generator_expressions.pyx +++ b/tests/run/inlined_generator_expressions.pyx @@ -145,5 +145,5 @@ def return_typed_sum_squares_start(seq, int start): >>> return_typed_sum_squares_start(range(10000), 9) 333283335009 """ - cdef int i + cdef long i return sum((i*i for i in seq), start) -- 2.26.2