Cython has moved to github.
cython-devel
view tests/run/simpcall.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 | b266823a2719 |
| children | 82d312a9f1fc |
line source
1 __doc__ = u"""
2 >>> z(1,9.2, b'test')
3 >>> failtype()
4 Traceback (most recent call last):
5 TypeError: an integer is required
7 >>> fail0(1,2)
8 Traceback (most recent call last):
9 TypeError: f() takes exactly 2 positional arguments (0 given)
11 >>> fail1(1,2)
12 Traceback (most recent call last):
13 TypeError: f() takes exactly 2 positional arguments (1 given)
14 """
16 import sys
17 if sys.version_info[0] < 3:
18 __doc__ = __doc__.replace(u" b'", u" '")
20 def f(x, y):
21 x = y
23 cdef void g(int i, float f, char *p):
24 f = i
26 cdef h(int i, obj):
27 i = obj
29 def z(a, b, c):
30 f(a, b)
31 f(a, b,)
32 g(1, 2.0, "spam")
33 g(a, b, c)
35 def fail0(a, b):
36 f()
38 def fail1(a, b):
39 f(a)
41 def failtype():
42 h(42, "eggs")
