Cleared file executable bit that was set earlier by a mistake
[cython.git] / tests / run / getattr3call.pyx
1 __doc__ = u"""
2     >>> class test(object): a = 1
3     >>> t = test()
4
5     >>> f(t, 'a')
6     1
7     >>> f(t, 'b')
8     Traceback (most recent call last):
9     AttributeError: 'test' object has no attribute 'b'
10
11     >>> g(t, 'a', 2)
12     1
13     >>> g(t, 'b', 2)
14     2
15 """
16
17 BROKEN = """
18     >>> h(t, 'a', 2)
19     1
20     >>> h(t, 'b', 2)
21     2
22 """
23
24 def f(a, b):
25     return getattr(a, b)
26
27 def g(a, b, c):
28     return getattr3(a, b, c)
29
30 #def h(a, b, c):
31 #    return getattr(a, b, c)