2009-05-29 | Paul Boddie | file changeset files shortlog | Changed RecoverFrame to actually recover the locals as the invocation frame, rather than just discard the locals. Changed AdjustFrame to work on the locals. Switched the order of the above instructions in instantiator functions. Made various tests compatible with the simple testing framework. |
paul@185 | 1 | #!/usr/bin/env python |
paul@185 | 2 | |
paul@185 | 3 | class C: |
paul@185 | 4 | def __call__(self): |
paul@229 | 5 | return 42 |
paul@185 | 6 | |
paul@185 | 7 | class D: |
paul@185 | 8 | def __init__(self, x): |
paul@185 | 9 | self.x = x |
paul@185 | 10 | |
paul@185 | 11 | c = C() |
paul@185 | 12 | d = D(c) |
paul@229 | 13 | result_42 = d.x() |
paul@185 | 14 | |
paul@185 | 15 | # vim: tabstop=4 expandtab shiftwidth=4 |