Cython has moved to github.

cython-devel

view tests/run/inop.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 5838c3d7edce
children 770b0d163e29
line source
1 __doc__ = u"""
2 >>> f(1,[1,2,3])
3 True
4 >>> f(5,[1,2,3])
5 False
6 >>> f(2,(1,2,3))
7 True
9 >>> g(1,[1,2,3])
10 1
11 >>> g(5,[1,2,3])
12 0
13 >>> g(2,(1,2,3))
14 1
16 >>> h([1,2,3,4])
17 True
18 >>> h([1,3,4])
19 False
21 >>> j([1,2,3,4])
22 1
23 >>> j([1,3,4])
24 0
26 >>> k(1)
27 1
28 >>> k(5)
29 0
31 >>> m(2)
32 1
33 >>> m(5)
34 0
36 >>> n('d *')
37 1
38 >>> n('xxx')
39 0
40 """
42 def f(a,b):
43 result = a in b
44 return result
46 def g(a,b):
47 cdef int result
48 result = a in b
49 return result
51 def h(b):
52 result = 2 in b
53 return result
55 def j(b):
56 cdef int result
57 result = 2 in b
58 return result
60 def k(a):
61 cdef int result = a in [1,2,3,4]
62 return result
64 def m(int a):
65 cdef int result = a in [1,2,3,4]
66 return result
68 def n(a):
69 cdef int result = a.lower() in [u'a *',u'b *',u'c *',u'd *']
70 return result