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