14 months ago | Paul Boddie | file changeset files shortlog | Merged changes from the value-replacement branch. | value-replacement-for-wrapper |
paul@820 | 1 | class C: |
paul@820 | 2 | def __init__(.x, .y, .z, x): # no explicit self, attributes initialised |
paul@820 | 3 | pass |
paul@820 | 4 | |
paul@820 | 5 | def c(): |
paul@820 | 6 | return self.x |
paul@820 | 7 | |
paul@820 | 8 | class D(C): |
paul@820 | 9 | def d(): |
paul@820 | 10 | return self.y |
paul@820 | 11 | |
paul@820 | 12 | class E(D): |
paul@820 | 13 | def c(): |
paul@820 | 14 | return self.z |
paul@820 | 15 | |
paul@820 | 16 | c = C(1, 2, 3, 4) |
paul@820 | 17 | d = D(1, 2, 3, 4) |
paul@820 | 18 | e = E(1, 2, 3, 4) |
paul@820 | 19 | |
paul@820 | 20 | print c.c() # 1 |
paul@820 | 21 | print d.c() # 1 |
paul@820 | 22 | print e.c() # 3 |
paul@820 | 23 | print d.d() # 2 |
paul@820 | 24 | print e.d() # 2 |