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@187 | 1 | #!/usr/bin/env python |
paul@187 | 2 | |
paul@187 | 3 | def f(a, b, c=a+b): |
paul@187 | 4 | return a + b + c |
paul@187 | 5 | |
paul@188 | 6 | a = 10 # used in f default |
paul@188 | 7 | b = 20 # used in f default |
paul@187 | 8 | x = f(1, 2) |
paul@187 | 9 | |
paul@187 | 10 | # vim: tabstop=4 expandtab shiftwidth=4 |