2009-02-09 | Paul Boddie | file changeset files shortlog | Speculative adjustment to contexts associated with new instances. Added a more advanced test of instance calling. |
paul@185 | 1 | #!/usr/bin/env python |
paul@185 | 2 | |
paul@185 | 3 | class C: |
paul@185 | 4 | def __call__(self): |
paul@185 | 5 | return "called" |
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@185 | 13 | d.x() |
paul@185 | 14 | |
paul@185 | 15 | # vim: tabstop=4 expandtab shiftwidth=4 |