1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# mode: run # ticket: 693 cdef double complex func(double complex x): print "hello" return x def test_coercion(): """ >>> c = test_coercion() hello >>> c.real == 0.5 True >>> c.imag == 1.5 True """ cdef object x = func(0.5 + 1.5j) return x