2021-06-29 | Paul Boddie | file changeset files shortlog | 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@840 | 1 | class C: |
paul@840 | 2 | def __init__(self, x, y, z): |
paul@840 | 3 | self.x = x |
paul@840 | 4 | self.y = y |
paul@840 | 5 | self.z = z |
paul@840 | 6 | |
paul@840 | 7 | def c(self): |
paul@840 | 8 | return self.x |
paul@840 | 9 | |
paul@840 | 10 | c = C(1, 2, 3) |
paul@840 | 11 | print c.c() # 1 |
paul@840 | 12 | print C.c() # bad |