Cython has moved to github.

cython-devel

view tests/run/cdefoptargs.pyx @ 912:fe3d5f426ff2

Fix optional cdef arguments for c++, possible optimization when not all args are used.
author Robert Bradshaw <robertwb@math.washington.edu>
date Sun Aug 03 04:02:45 2008 -0700 (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))