Cython has moved to github.
cython-devel
view tests/run/forfrom.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 | 8501d950afc3 |
| children | 82d312a9f1fc |
line source
1 __doc__ = u"""
2 >>> for_else()
3 30
4 >>> print( u'*'.join(int_comp()) )
5 00*01*02
6 """
8 import sys
9 if sys.version_info[0] >= 3:
10 __doc__ = __doc__.replace(u" u'", u" '").replace(u' u"', u' "')
12 def for_else():
13 cdef int i, j=0, k=2
14 for i from 0 <= i < 10:
15 j += k
16 else:
17 k = j+10
18 return k
20 def int_comp():
21 cdef int i
22 return tuple([ u"%02d" % i
23 for i from 0 <= i < 3 ])
