more type check removal during optimisations
authorStefan Behnel <scoder@users.berlios.de>
Thu, 15 Apr 2010 14:25:13 +0000 (16:25 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 15 Apr 2010 14:25:13 +0000 (16:25 +0200)
Cython/Compiler/Optimize.py

index c9b24851f52ee16439faeadea2f9bfbd5873acbc..1a574f5f50999fe6dd97abbf3c7fa9d52800731b 100644 (file)
@@ -1066,6 +1066,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
                 return arg
             else:
                 return arg.coerce_to(node.type, self.current_env())
+        if isinstance(arg, ExprNodes.PyTypeTestNode):
+            arg = arg.arg
         if isinstance(arg, ExprNodes.CoerceToPyTypeNode):
             if arg.type is PyrexTypes.py_object_type:
                 if node.type.assignable_from(arg.arg.type):