summaryrefslogtreecommitdiff
path: root/tests/run/inlinepxd.pyx
blob: 65c596c369805b2c4f073c71d4eec0877714d78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# mode: run
# tag: inline, pxd

# cython: wraparound = False

__doc__ = u"""
>>> f()
3
>>> g()
6
>>> h()
6
>>> i()
6
>>> j()
6
"""

cimport inlinepxd_support
from inlinepxd_support cimport my_add as my_add3

def f():
    return my_add(1, 2)

def g():
    return inlinepxd_support.my_add(1, 2, 3)

def h():
    return my_add3(1, 2, 3)

def i():
    return my_add3(5)

def j():
    return my_add3(2, 4)

def test_wraparound():
    """
    >>> test_wraparound()
    1.0
    """
    # the wraparound directive from this scope should not affect the inline pxd
    a = [ 0.0, 1.0 ]
    return inlinepxd_support.index(a)