2008-08-18 | Paul Boddie | file changeset files shortlog | Added a class table which should provide run-time support for class compatibility testing. Improved optimisation activities to remove active value-providing instructions only where appropriate. Added more simple-input-employing instructions. Added notes about context discovery and replacement at run-time. Made the raw code dump include class contexts for class attributes where appropriate. Improved the tests of attribute access and invocation. |
paul@43 | 1 | #!/usr/bin/env python |
paul@43 | 2 | |
paul@43 | 3 | class C: |
paul@43 | 4 | clsattr = 123 |
paul@43 | 5 | |
paul@43 | 6 | def __init__(self, value): |
paul@43 | 7 | self.instattr = value |
paul@91 | 8 | self.clsattr |
paul@91 | 9 | |
paul@91 | 10 | def update(self, value): |
paul@91 | 11 | self.attr = value |
paul@106 | 12 | C.clsattr |
paul@43 | 13 | |
paul@86 | 14 | C |
paul@86 | 15 | C.clsattr |
paul@86 | 16 | |
paul@43 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |