2012-06-04 | Paul Boddie | file changeset files shortlog | Simplify attribute assignment by insisting on the types identified from usage observations, only noting assignments on those and not on any type that could support a particular attribute. |
paul@394 | 1 | #!/usr/bin/env python |
paul@394 | 2 | |
paul@394 | 3 | class A: |
paul@394 | 4 | pass |
paul@394 | 5 | |
paul@394 | 6 | class B(A): |
paul@394 | 7 | pass |
paul@394 | 8 | |
paul@394 | 9 | class C: |
paul@394 | 10 | pass |
paul@394 | 11 | |
paul@394 | 12 | result_1 = A.__class__ is type and 1 or 0 |
paul@394 | 13 | result_2 = B.__class__ is type and 2 or 0 |
paul@394 | 14 | result_3 = C.__class__ is type and 3 or 0 |
paul@394 | 15 | |
paul@394 | 16 | # vim: tabstop=4 expandtab shiftwidth=4 |