Lichen

Annotated tests/methods_selfless.py

934:2989aab1b4f7
10 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.
paul@46 1
class C:
paul@46 2
    def __init__(x, y, z): # no explicit self
paul@46 3
        self.x = x
paul@46 4
        self.y = y
paul@46 5
        self.z = z
paul@46 6
paul@46 7
    def c():
paul@46 8
        return self.x
paul@46 9
paul@46 10
class D(C):
paul@46 11
    def d():
paul@46 12
        return self.y
paul@46 13
paul@46 14
class E(D):
paul@46 15
    def c():
paul@46 16
        return self.z
paul@46 17
paul@46 18
c = C(1, 2, 3)
paul@46 19
d = D(1, 2, 3)
paul@46 20
e = E(1, 2, 3)
paul@46 21
paul@214 22
print c.c() # 1
paul@214 23
print d.c() # 1
paul@214 24
print e.c() # 3
paul@214 25
print d.d() # 2
paul@214 26
print e.d() # 2