2009-05-23 | Paul Boddie | file changeset files shortlog | Added callable context vs. self argument validation in CheckFrame, plus a test which detects an attempt to fake the self argument with an incompatible instance. |
paul@189 | 1 | #!/usr/bin/env python |
paul@189 | 2 | |
paul@189 | 3 | def f(a, b, c=4): |
paul@190 | 4 | return c |
paul@189 | 5 | |
paul@189 | 6 | g = f |
paul@218 | 7 | r1 = g(1, c=3, b=2) # -> 3 |
paul@218 | 8 | r2 = g(1, 2) # -> 4 |
paul@189 | 9 | |
paul@189 | 10 | def g(a, c, b=5): |
paul@190 | 11 | return b |
paul@189 | 12 | |
paul@218 | 13 | r3 = g(1, c=3, b=2) # -> 2 |
paul@218 | 14 | r4 = g(1, 3) # -> 5 |
paul@189 | 15 | |
paul@189 | 16 | # vim: tabstop=4 expandtab shiftwidth=4 |