Cython has moved to github.

cython-devel

view tests/run/and.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 d74e318560bd
children 82d312a9f1fc
line source
1 __doc__ = u"""
2 >>> a,b = 'a *','b *' # use non-interned strings
4 >>> and2_assign(2,3) == (2 and 3)
5 True
6 >>> and2_assign('a', 'b') == ('a' and 'b')
7 True
8 >>> and2_assign(a, b) == (a and b)
9 True
11 >>> and2(2,3) == (2 and 3)
12 True
13 >>> and2(0,2) == (0 and 2)
14 True
15 >>> and2('a', 'b') == ('a' and 'b')
16 True
17 >>> and2(a, b) == (a and b)
18 True
19 >>> and2('', 'b') == ('' and 'b')
20 True
21 >>> and2([], [1]) == ([] and [1])
22 True
23 >>> and2([], [a]) == ([] and [a])
24 True
26 >>> and3(0,1,2) == (0 and 1 and 2)
27 True
28 >>> and3([],(),[1]) == ([] and () and [1])
29 True
31 >>> and2_no_result(2,3)
32 >>> and2_no_result(0,2)
33 >>> and2_no_result('a','b')
34 >>> and2_no_result(a,b)
35 >>> a and b
36 'b *'
37 """
39 def and2_assign(a,b):
40 c = a and b
41 return c
43 def and2(a,b):
44 return a and b
46 def and3(a,b,c):
47 d = a and b and c
48 return d
50 def and2_no_result(a,b):
51 a and b