From 220305178e3584c114503768cd3316bff171beea Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 20 Oct 2009 21:16:12 +0200 Subject: [PATCH] fix switch transform --- Cython/Compiler/ExprNodes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 58e7878f..d61d36de 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5168,6 +5168,11 @@ class CmpNode(object): error(self.pos, "Invalid types for '%s' (%s, %s)" % (op, operand1.type, operand2.type)) + def is_python_comparison(self): + return (self.has_python_operands() + or (self.cascade and self.cascade.is_python_comparison()) + or self.operator in ('in', 'not_in')) + def coerce_operands_to(self, dst_type, env): operand2 = self.operand2 if operand2.type != dst_type: -- 2.26.2