cleanup
authorStefan Behnel <scoder@users.berlios.de>
Thu, 27 May 2010 17:58:16 +0000 (19:58 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 27 May 2010 17:58:16 +0000 (19:58 +0200)
Cython/Compiler/Optimize.py
tests/run/inlined_generator_expressions.pyx

index 00c69c34c186de2b87efca98b1294f335e379029..f0c793899e211d99b723e196adac3eb345a3440d 100644 (file)
@@ -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):
index 9bc9430c7ff8bb93e391732189591e9736c742aa..b2843f7539489bf6bb56e21982287c4cc2f8bf78 100644 (file)
@@ -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 <long>sum((i*i for i in seq), start)