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@372 | 1 | #!/usr/bin/env python |
paul@372 | 2 | |
paul@373 | 3 | class C: |
paul@373 | 4 | def __getitem__(self, slice): |
paul@373 | 5 | return slice.start |
paul@372 | 6 | |
paul@373 | 7 | class D: |
paul@373 | 8 | def __getitem__(self, slice): |
paul@373 | 9 | return slice.end |
paul@373 | 10 | |
paul@373 | 11 | c = C() |
paul@373 | 12 | d = D() |
paul@373 | 13 | result_3 = c[3:] |
paul@373 | 14 | result_4 = d[:4] |
paul@372 | 15 | |
paul@372 | 16 | # vim: tabstop=4 expandtab shiftwidth=4 |