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@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 |