Cython has moved to github.

cython-devel

view tests/run/cdefoptargs.pyx @ 1622:4f0327bdebc9

test for temp allocation bug in call
author Robert Bradshaw <robertwb@math.washington.edu>
date Sat Jan 17 01:25:34 2009 -0800 (3 years ago)
parents e76fe15f4af7
children 82d312a9f1fc
line source
1 __doc__ = u"""
2 >>> call2()
3 >>> call3()
4 >>> call4()
5 >>> test_foo()
6 2
7 3
8 7
9 26
10 """
12 # the calls:
14 def call2():
15 b(1,2)
17 def call3():
18 b(1,2,3)
20 def call4():
21 b(1,2,3,4)
23 # the called function:
25 cdef b(a, b, c=1, d=2):
26 pass
29 cdef int foo(int a, int b=1, int c=1):
30 return a+b*c
32 def test_foo():
33 print foo(1)
34 print foo(1, 2)
35 print foo(1, 2, 3)
36 print foo(1, foo(2, 3), foo(4))