Temporary fix for #441
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 2 Nov 2009 19:50:02 +0000 (20:50 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 2 Nov 2009 19:50:02 +0000 (20:50 +0100)
Cython/Compiler/PyrexTypes.py
tests/run/complex_numbers_T305.pyx

index 4ca7f3d50c2517243b15e7a45fcd59c0eaec5382..282c51980d8d251cfdd98e52e4796309c72be350 100644 (file)
@@ -913,6 +913,13 @@ class CComplexType(CNumericType):
         real_type_name = real_type_name.replace('long__double','long_double')
         return Naming.type_prefix + real_type_name + "_complex"
     
+    def assignable_from(self, src_type):
+        # Temporary hack/feature disabling, see #441
+        if not src_type.is_complex and src_type.is_numeric and src_type.is_typedef:
+            return False
+        else:
+            return super(CComplexType, self).assignable_from(src_type)
+        
     def assignable_from_resolved_type(self, src_type):
         return (src_type.is_complex and self.real_type.assignable_from_resolved_type(src_type.real_type)
                     or src_type.is_numeric and self.real_type.assignable_from_resolved_type(src_type) 
index e59e0a412aca2ba95f9241380c5381ca4ff46d6e..6ae5aaad35f2fde1b2c43c33d661ae3a2c5b69ff 100644 (file)
@@ -125,13 +125,13 @@ ctypedef double complex cdouble
 def test_conjugate_typedef(cdouble z):
     return z.conjugate()
 
-ctypedef double mydouble
-def test_coerce_typedef_multiply(mydouble x, double complex z):
-    """
-    >>> test_coerce_typedef_multiply(3, 1j)
-    (3j)
-    """
-    return x * z
+#ctypedef double mydouble
+#def test_coerce_typedef_multiply(mydouble x, double complex z):
+#    """
+#    >>> test_coerce_typedef_multiply(3, 1j)
+#    (3j)
+#    """
+#    return x * z
 
 cpdef double complex complex_retval():
     """