Cython has moved to github.
cython-devel
view tests/run/getattr3call.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 | 0edf1d4089e4 |
| children | b9d8cecc8975 |
line source
1 __doc__ = u"""
2 >>> class test(object): a = 1
3 >>> t = test()
5 >>> f(t, 'a')
6 1
7 >>> f(t, 'b')
8 Traceback (most recent call last):
9 AttributeError: 'test' object has no attribute 'b'
11 >>> g(t, 'a', 2)
12 1
13 >>> g(t, 'b', 2)
14 2
15 """
17 BROKEN = """
18 >>> h(t, 'a', 2)
19 1
20 >>> h(t, 'b', 2)
21 2
22 """
24 def f(a, b):
25 return getattr(a, b)
27 def g(a, b, c):
28 return getattr3(a, b, c)
30 #def h(a, b, c):
31 # return getattr(a, b, c)
