Cython has moved to github.
cython-devel
view tests/run/pyextattrref.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 | 36726a88f397 |
| children |
line source
1 __doc__ = u"""
2 >>> s = Spam(Eggs("ham"))
3 >>> test(s)
4 'ham'
5 """
7 cdef class Eggs:
8 cdef object ham
9 def __init__(self, ham):
10 self.ham = ham
12 cdef class Spam:
13 cdef Eggs eggs
14 def __init__(self, eggs):
15 self.eggs = eggs
17 cdef object tomato(Spam s):
18 food = s.eggs.ham
19 return food
21 def test(Spam s):
22 return tomato(s)
