2009-05-01 | Paul Boddie | file changeset files shortlog | Removed the instance attribute from DataObject (the common data structure), employing the presence of a value on the attrcode attribute to indicate the instance status of objects. |
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@199 | 13 | result = d.x() |
paul@185 | 14 | |
paul@185 | 15 | # vim: tabstop=4 expandtab shiftwidth=4 |