summaryrefslogtreecommitdiff
path: root/tests/run/complex_coercion_sideeffects_T693.pyx
blob: 92b1f94a914fcfb87ff6f2dcabab64c2ad2ac1b3 (plain)
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