From 87ccc971197f6b245718029194f83c34864e8012 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 28 Sep 2012 18:22:15 +0200 Subject: [PATCH] avoid unnecessary safety temping of function arguments that are builtins or read-only variables (e.g. extension types) --- Cython/Compiler/ExprNodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index d73331d..c9417a4 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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 -- 2.7.4