2010-06-11 | Paul Boddie | raw annotate files changeset graph | Replaced the native mechanism for list initialisation with a Python-based list.__init__ method and a simplified native method for initialising the initial list fragment. Introduced automatic namespace traversal of __init__ attributes for any namespace providing such attributes. Unfortunately, this inflates the program size substantially and needs to be reviewed. Enabled proper testing of xrange instances using the updated support for list initialisation. |
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 0 # stops the test loop 10 11 def g(self): 12 return 3 13 14 class E: 15 def f(self): 16 return 4 17 18 def h(self): # unused 19 return 5 20 21 def test_loop(obj, obj2): 22 while obj.f(): 23 obj = obj2 24 obj.g() 25 return obj.f() 26 27 c = C() 28 d = D() 29 e = E() 30 result1_0 = test_loop(c, d) 31 32 # vim: tabstop=4 expandtab shiftwidth=4