From: Stefan Behnel Date: Thu, 15 Apr 2010 14:20:11 +0000 (+0200) Subject: fix coercion optimisation X-Git-Tag: 0.13.beta0~198 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d15bbcd442ca488df7740a12d674669172499fa7;p=cython.git fix coercion optimisation --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index cb2666e9..c9b24851 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1044,6 +1044,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform): """ self.visitchildren(node) arg = node.arg + if isinstance(arg, ExprNodes.PyTypeTestNode): + arg = arg.arg if isinstance(arg, ExprNodes.CoerceToPyTypeNode): if arg.type in (PyrexTypes.py_object_type, Builtin.bool_type): return arg.arg.coerce_to_boolean(self.current_env())