2016-11-23 | Paul Boddie | file changeset files shortlog | Fixed list and tuple initialisation via their initialisers. Introduced generic string representation support for sequences. Removed superfluous tuple native functions. Added element-setting and size-setting native functions for fragments. Added __setitem__ support for sequences. Added initialisation and serialisation tests for lists and tuples. |
paul@206 | 1 | l = [1, 2, 3] |
paul@221 | 2 | l.append("four") |
paul@206 | 3 | print len(l) |
paul@206 | 4 | print l[0] |
paul@206 | 5 | print l[1] |
paul@206 | 6 | print l[2] |
paul@206 | 7 | print l[3] |
paul@207 | 8 | print l[-1] |
paul@207 | 9 | print l[-2] |
paul@207 | 10 | print l[-3] |
paul@207 | 11 | print l[-4] |
paul@220 | 12 | print l |
paul@227 | 13 | |
paul@227 | 14 | t = (1, 2, 3, "four") |
paul@227 | 15 | l = list(t) |
paul@227 | 16 | print l |