2016-11-27 | Paul Boddie | file changeset files shortlog | Return class names for string representations, making instance representations more verbose. |
paul@2 | 1 | def f(): |
paul@2 | 2 | s = "test" |
paul@2 | 3 | m = s.__len__ |
paul@2 | 4 | n = "test".__len__ |
paul@199 | 5 | print m() |
paul@199 | 6 | print n() |
paul@2 | 7 | |
paul@2 | 8 | def g(): |
paul@2 | 9 | l = [1] |
paul@2 | 10 | m = l.__len__ |
paul@2 | 11 | n = [1].__len__ |
paul@199 | 12 | print m() |
paul@199 | 13 | print n() |
paul@2 | 14 | |
paul@2 | 15 | f() |
paul@2 | 16 | g() |