2017-02-22 | Paul Boddie | file changeset files shortlog | Fixed the testing of attribute usage. | method-wrapper-for-context |
paul@588 | 1 | class C: |
paul@588 | 2 | def __init__(self, x): |
paul@588 | 3 | self.x = x |
paul@588 | 4 | |
paul@588 | 5 | def value(self): |
paul@588 | 6 | return self.x |
paul@588 | 7 | |
paul@588 | 8 | def length(self): |
paul@588 | 9 | return self.double(self.value()) |
paul@588 | 10 | |
paul@588 | 11 | def double(self, x): |
paul@588 | 12 | return x * 2 |
paul@588 | 13 | |
paul@588 | 14 | c = C(3) |
paul@588 | 15 | print c.length() # 6 |