Cython has moved to github.
cython-devel
view tests/run/unop.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 | ff6249a604c2 |
| children | 82d312a9f1fc |
line source
1 __doc__ = u"""
2 >>> f(1, 2, 3)
3 (-3, -4, 1)
4 """
6 def f(obj1, obj2, obj3):
7 cdef int bool1, bool2
8 cdef int int1, int2
9 cdef char *str1
11 int2 = obj3
12 str1 = NULL
13 bool2 = 0
15 bool1 = not bool2
16 obj1 = not obj2
17 bool1 = not str1
18 int1 = +int2
19 obj1 = +obj2
20 int1 = -int2
21 obj1 = -obj2
22 int1 = ~int2
23 obj1 = ~obj2
24 return obj1, int1, bool1
