2012-02-27 | Paul Boddie | file changeset files shortlog | Added general attribute usage recording for attribute assignments on self, even though specific attribute usage is also recorded. This prevents usage from being inadvertently incomplete. Added tests demonstrating the contribution of attribute assignments to usage observations. |
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 |