2018-06-24 | Paul Boddie | raw annotate files changeset graph | Changed target handling in the invocation code to eliminate superfluous temporary storage for targets and to treat context and target storage separately. Changed access instruction generation to expose the accessor test instructions more readily to the translator, with the error conversion being introduced by the translator. This allows the presence of accessor tests to be considered by the translator and for such tests to be included in generated code where they might otherwise be optimised away. Fixed detection of context temporary variables. Simplified the tracking of target and context temporary usage. |
1 class MixIn: 2 def f(self): 3 return self.g() 4 def f2(self): 5 return self.g2() 6 7 class Concrete(MixIn): 8 def g(self): 9 return 13579 10 def g2(self): 11 return 13579 12 13 class Cement(MixIn): 14 def g2(self): 15 return 24680 16 17 m = MixIn() 18 19 try: 20 print m.f() 21 except TypeError: 22 print "m.f: cannot obtain attribute" 23 24 c = Concrete() 25 print c.f() # 13579 26 27 try: 28 print m.f2() 29 except TypeError: 30 print "m.f2: cannot obtain attribute" 31 32 c2 = Cement() 33 print c2.f2() # 24680