avoid unnecessary safety temping of function arguments that are builtins or read...
authorStefan Behnel <stefan_ml@behnel.de>
Fri, 28 Sep 2012 16:22:15 +0000 (18:22 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Fri, 28 Sep 2012 16:22:15 +0000 (18:22 +0200)
Cython/Compiler/ExprNodes.py

index d73331d..c9417a4 100755 (executable)
@@ -1617,7 +1617,9 @@ class NameNode(AtomicExprNode):
         if ExprNode.nonlocally_immutable(self):
             return True
         entry = self.entry
-        return entry and (entry.is_local or entry.is_arg) and not entry.in_closure
+        if not entry or entry.in_closure:
+            return False
+        return entry.is_local or entry.is_arg or entry.is_builtin or entry.is_readonly
 
     def calculate_target_results(self, env):
         pass