Lichen

tests/methods_bound.py

227:3a4ba5788f0f
2016-11-23 Paul Boddie 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.
     1 class C:     2     def m(self, x):     3         return x     4      5 def f(obj, i):     6     if i:     7         return obj.m(i)     8     else:     9         return obj.m    10     11 c = C()    12 print f(c, 1)    # 1    13 print f(c, 0)(2) # 2    14 fn = f(c, 0)    15 print fn(2)      # 2