2016-11-26 | Paul Boddie | file changeset files shortlog | Changed serialisation to handle classes separately, since <class>.__str__ and <class>.__repr__ are interpreted as type.__str__ and type.__repr__ respectively (being provided by the class of <class>), but these methods would always be unbound even if directly obtained from <class>. |
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() |