2016-10-13 | Paul Boddie | raw annotate files changeset graph | Fixed instruction plan test operations, optimised the initial accessor to avoid redundant assignments and to use the context where appropriate, introduced accessor and attribute name parameterisation in the generated instructions, introduced a generic expression placeholder in place of any local name. |
1 class C: 2 def __init__(x, y, z): # no explicit self 3 self.x = x 4 self.y = y 5 self.z = z 6 7 def c(): 8 return self.x 9 10 class D(C): 11 def d(): 12 return self.y 13 14 class E(D): 15 def c(): 16 return self.z 17 18 c = C(1, 2, 3) 19 d = D(1, 2, 3) 20 e = E(1, 2, 3) 21 22 result1 = c.c() # 1 23 result2 = d.c() # 1 24 result3 = e.c() # 3 25 result4 = d.d() # 2 26 result5 = e.d() # 2