From 193388a369b5306693694ff60a1941d4de0e7168 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 4 Dec 2010 10:46:51 +0100 Subject: [PATCH] extended test case --- tests/run/builtincomplex.pyx | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- 2.26.2