2013-10-24 | Paul Boddie | raw annotate files changeset graph | Added _attr annotations to AssName nodes, indicating attributes providing names. | syspython-as-target |
1 #!/usr/bin/env python 2 3 class C: 4 def x(self, obj): 5 return getattr(obj, "y")(obj) 6 7 def y(self, obj): 8 return getattr(obj, "z")(obj) 9 10 def z(self, obj): 11 return 1 12 13 class D: 14 def x(self): 15 return 2 16 17 def f(obj, attrname): 18 return getattr(obj, attrname)(obj) 19 20 c = C() 21 d = D() 22 result_1 = f(c, "x")() 23 result_2 = f(d, "x")() 24 25 # vim: tabstop=4 expandtab shiftwidth=4