2013-01-13 | Paul Boddie | raw annotate files changeset graph | Added a test of the first form of B. |
1 #!/usr/bin/env python 2 3 class C: 4 p = 123 5 6 class D: 7 p = 456 8 9 x = C 10 11 def change(): 12 global x 13 x = D 14 15 def use(y): 16 return y.p # usage of p 17 18 def f(): 19 return x.p # ambiguous 20 21 change() 22 result1_456 = x.p 23 result2_456 = f() 24 result3_456 = use(x) 25 26 # vim: tabstop=4 expandtab shiftwidth=4