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): |
paul@211 | 4 | return b |
paul@189 | 5 | |
paul@211 | 6 | def h(a, b, c=f(5, 4, 3)): |
paul@189 | 7 | return c |
paul@189 | 8 | |
paul@211 | 9 | x = h(1, 2, 3) # -> 3 |
paul@211 | 10 | y = h(1, 2) # -> 4 |
paul@189 | 11 | |
paul@189 | 12 | # vim: tabstop=4 expandtab shiftwidth=4 |