Lichen

tests/nested.py

934:2989aab1b4f7
7 months ago Paul Boddie Renamed the utf8string class to unicode, eliminating the unicode function. This means that the simple case of merely returning an object if it is already a Unicode object no longer occurs when using the unicode callable, but such behaviour might be better supported with more general customised instantiation functionality.
     1 a = 4     2      3 def f(x):     4     def g(y, x=x):     5         def h(z, x=x, y=y):     6             return x, y, z, a     7         return h     8     return g     9     10 fn = f(1)    11 print fn                        # __main__.f.$l0    12 print fn(2)                     # __main__.f.$l0.$l0    13 print fn(2)(3)                  # (1, 2, 3, 4)    14 print fn(2)(3, 5)               # (5, 2, 3, 4)    15 print fn(2)(3, 5, 6)            # (5, 6, 3, 4)