1 #!/usr/bin/env python 2 3 class C: 4 def e(self): 5 return 2 6 7 def f(self): 8 return 1 9 10 class D: 11 def e(self): 12 return 6 13 14 def f(self): 15 return 0 # stops the test loop 16 17 def g(self): 18 return 3 19 20 class E: 21 def f(self): 22 return 4 23 24 def h(self): # unused 25 return 5 26 27 def test_loop(obj, obj2): 28 while obj.f(): 29 obj = obj2 30 obj.g() 31 else: 32 obj.e() 33 return obj.f() 34 35 c = C() 36 d = D() 37 e = E() 38 result1_0 = test_loop(c, d) 39 40 # vim: tabstop=4 expandtab shiftwidth=4