2012-07-10 | Paul Boddie | file changeset files shortlog | Simplified operator function name output, fixing the binary bit operators. |
paul@43 | 1 | #!/usr/bin/env python |
paul@43 | 2 | |
paul@43 | 3 | class C: |
paul@43 | 4 | clsattr = 123 |
paul@91 | 5 | |
paul@219 | 6 | def __init__(self, value=None): |
paul@219 | 7 | self.instattr = value is None and self.clsattr or value |
paul@43 | 8 | |
paul@219 | 9 | c1 = C(789) |
paul@219 | 10 | c2 = C() |
paul@228 | 11 | result_789 = c1.instattr |
paul@228 | 12 | result_123 = c2.instattr |
paul@86 | 13 | |
paul@43 | 14 | # vim: tabstop=4 expandtab shiftwidth=4 |