From: Stefan Behnel Date: Sat, 4 Dec 2010 09:46:51 +0000 (+0100) Subject: extended test case X-Git-Tag: 0.14.alpha0~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=193388a369b5306693694ff60a1941d4de0e7168;p=cython.git extended test case --- diff --git a/tests/run/builtincomplex.pyx b/tests/run/builtincomplex.pyx index 60361175..90a24b48 100644 --- a/tests/run/builtincomplex.pyx +++ b/tests/run/builtincomplex.pyx @@ -27,3 +27,13 @@ def complex_cstruct_assign(): cval = &c.cval cval.real, cval.imag = 10, 20 return (c.real, c.imag) + +def complex_coercion(): + """ + >>> complex_coercion() + (1.0, 2.0, 1.0, 2.0) + """ + cdef complex py_c = 1+2j + cdef double complex c_c = py_c + cdef object py = c_c + return (c_c.real, c_c.imag, py.real, py.imag)