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@557 | 1 | class C: |
paul@557 | 2 | def f(self, x, y, z): |
paul@557 | 3 | return z |
paul@557 | 4 | |
paul@557 | 5 | class D: |
paul@557 | 6 | def f(self, a, b, c): |
paul@557 | 7 | return c |
paul@557 | 8 | |
paul@557 | 9 | def pqr(obj): |
paul@557 | 10 | return obj.f(1, 2, r=3) # no corresponding function |
paul@557 | 11 | |
paul@557 | 12 | c = C() |
paul@557 | 13 | d = D() |
paul@557 | 14 | |
paul@557 | 15 | print pqr(c) # should fail |