2021-10-31 | Paul Boddie | file changeset files shortlog | Introduced a dedicated integer type based on ssize_t. This allows integers to be used for sizes and lengths in native and low-level operations whilst also supporting their storage in the same amount of space as a pointer, thus avoiding the inflation of attributes that might occur if a larger type were chosen. |
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 |