diff options
author | Nils Braun <nils.braun@kit.edu> | 2017-10-28 16:03:37 +0200 |
---|---|---|
committer | Nils Braun <nils.braun@kit.edu> | 2017-10-28 16:03:37 +0200 |
commit | ab7b75cd4db9ddab7f5456ed1cfdc3b0e11ffb98 (patch) | |
tree | d0a31c8d681d9fdae99c8f31d564db77bd87f16e | |
parent | 40b884673dc0ec01c5139f4303f88fd1830c9fb8 (diff) | |
download | cython-ab7b75cd4db9ddab7f5456ed1cfdc3b0e11ffb98.tar.gz |
Return a pythran expr when interfering the types in a compare node
-rw-r--r-- | Cython/Compiler/ExprNodes.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index d2ee031af..e56088cb1 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -12246,7 +12246,13 @@ class PrimaryCmpNode(ExprNode, CmpNode): is_memslice_nonecheck = False def infer_type(self, env): - # TODO: Actually implement this (after merging with -unstable). + type1 = self.operand1.infer_type(env) + type2 = self.operand2.infer_type(env) + + if is_pythran_expr(type1) or is_pythran_expr(type2): + if is_pythran_supported_type(type1) and is_pythran_supported_type(type2): + return PythranExpr(pythran_binop_type(self.operator, type1, type2)) + return py_object_type def type_dependencies(self, env): |