2009-05-09 | Paul Boddie | file changeset files shortlog | Removed erroneous remark about __init__ and __call__ defaults. Added a test of __init__ defaults. Improved and renamed the invocation with non-constant defaults test. |
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@190 | 7 | r1 = g(1, c=3, b=2) |
paul@190 | 8 | r2 = g(1, 2) |
paul@189 | 9 | |
paul@189 | 10 | def g(a, c, b=5): |
paul@190 | 11 | return b |
paul@189 | 12 | |
paul@190 | 13 | r3 = g(1, c=3, b=2) |
paul@190 | 14 | r4 = g(1, 3) |
paul@189 | 15 | |
paul@189 | 16 | # vim: tabstop=4 expandtab shiftwidth=4 |