Cython has moved to github.

cython-devel

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