disable tuple(genexpr) as it has a non-obvious negative effect on memory usage -...
authorStefan Behnel <scoder@users.berlios.de>
Sun, 30 May 2010 17:42:15 +0000 (19:42 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 30 May 2010 17:42:15 +0000 (19:42 +0200)
Cython/Compiler/Optimize.py
tests/run/inlined_generator_expressions.pyx

index 8ab5f8e378c183383d605fdcbbc634b2409ce749..1e736fad48374796b5486e30ac37b7b0a131c33f 100644 (file)
@@ -1186,7 +1186,7 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
             gen_expr_node.pos, loop = exec_code, result_node = result_ref,
             expr_scope = gen_expr_node.expr_scope, orig_func = 'sum')
 
-    def _handle_simple_function_tuple(self, node, pos_args):
+    def _DISABLED_handle_simple_function_tuple(self, node, pos_args):
         if len(pos_args) == 0:
             return ExprNodes.TupleNode(node.pos, args=[], constant_result=())
         # This is a bit special - for iterables (including genexps),
index 4685c3e2ce6726f9f5ca2ef98976b80b52df2b29..eee9a9bc96bc1782dac7a4bf5b83284da59fdf5d 100644 (file)
@@ -1,12 +1,12 @@
 
 cimport cython
 
-def range_tuple_genexp(int N):
-    """
-    >>> range_tuple_genexp(5)
-    (0, 1, 2, 3, 4)
-    """
-    return tuple(i for i in range(N))
+## def range_tuple_genexp(int N):
+##     """
+##     >>> range_tuple_genexp(5)
+##     (0, 1, 2, 3, 4)
+##     """
+##     return tuple(i for i in range(N))
 
 
 @cython.test_assert_path_exists('//ForFromStatNode',