2010-06-02 | Paul Boddie | file changeset files shortlog | Removed usage of getattr by introducing lambda functions providing the methods specific to each operation. |
paul@294 | 1 | #!/usr/bin/env python |
paul@294 | 2 | |
paul@294 | 3 | class C: |
paul@294 | 4 | def f(self): |
paul@294 | 5 | return self.x |
paul@294 | 6 | |
paul@294 | 7 | class D(C): |
paul@294 | 8 | def __init__(self): |
paul@294 | 9 | self.x = 456 |
paul@294 | 10 | |
paul@294 | 11 | d = D() |
paul@294 | 12 | result_456 = d.f() |
paul@294 | 13 | |
paul@294 | 14 | # vim: tabstop=4 expandtab shiftwidth=4 |