From: Stefan Behnel Date: Tue, 20 Oct 2009 19:16:12 +0000 (+0200) Subject: fix switch transform X-Git-Tag: 0.13.beta0~2^2~121^2~2 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=220305178e3584c114503768cd3316bff171beea;p=cython.git fix switch transform --- 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: