Lichen

tests/lambda.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 f = lambda x: (x, 1)     2      3 class C:     4     f = lambda x: (x, 2)     5      6 print f(123)            # (123, 1)     7      8 c = C()     9 print c.f               # __main__.C.$l0    10 print c.f(123)          # (123, 2)    11     12 c.f = f    13 print c.f(123)          # (123, 1)    14     15 C.f = f    16 c2 = C()    17 print c2.f(123)         # (123, 1)