2013-11-29 | Paul Boddie | raw annotate files changeset graph | Fixed the scope of defaults and added the setdefaults special function for the initialisation of defaults for non-dynamic functions. | syspython-as-target |
1 #!/usr/bin/env python 2 3 class C: 4 def f(self): 5 return 1 6 7 class D: 8 def f(self): 9 return 2 10 11 def g(self): 12 return 3 13 14 class E: 15 def f(self): 16 return 4 17 18 def h(self): 19 return 5 20 21 def test_conditional(obj): 22 # obj: f, g; f, h 23 if obj.f(): 24 return obj.g() 25 else: 26 return obj.h() 27 28 c = C() 29 d = D() 30 e = E() 31 result1_3 = test_conditional(d) 32 33 # vim: tabstop=4 expandtab shiftwidth=4