complex number coercion fix
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 31 Oct 2009 20:52:55 +0000 (13:52 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 31 Oct 2009 20:52:55 +0000 (13:52 -0700)
Cython/Compiler/PyrexTypes.py

index e7ffb1d764eea34f1e530f9b1f9234851afd3b87..4ca7f3d50c2517243b15e7a45fcd59c0eaec5382 100644 (file)
@@ -882,6 +882,12 @@ class CComplexType(CNumericType):
             return self.real_type == other.real_type
         else:
             return False
+    
+    def __ne__(self, other):
+        if isinstance(self, CComplexType) and isinstance(other, CComplexType):
+            return self.real_type != other.real_type
+        else:
+            return True
 
     def __lt__(self, other):
         if isinstance(self, CComplexType) and isinstance(other, CComplexType):