2016-10-14 | Paul Boddie | raw annotate files changeset graph | Introduced access mode information for unambiguously-traversed attributes so that the appropriate instruction can be generated. Removed the generation of augmented attribute access plans and the computation of general attribute position ambiguity, since the information will not be used: in cases where ambiguity might need to be determined, attributes must be checked to determine their exact nature even if unambiguous. |
1 class C: 2 def c(self): 3 return 1 4 5 class D: 6 def d(self): 7 return 3 8 9 a = 4 10 11 def f(x): 12 x.c() 13 def g(y, x=x): # x must be introduced as default here 14 if y: 15 x = D() 16 return x.d(), y, a # UnboundLocalError in Python (if y is a false value) 17 return g 18 19 result = f(C())(2) 20 assert result == (3, 2, 4)