2010-06-05 | Paul Boddie | file changeset files shortlog | Changed parameter initialisation to explicitly use Instance() instead of None. Made the default parameter value code use the same mechanisms as other attribute-setting code. Added tests of lambdas and nested functions with locally defined defaults. |
paul@329 | 1 | #!/usr/bin/env python |
paul@329 | 2 | |
paul@329 | 3 | def a(x): |
paul@329 | 4 | def b(p=x): |
paul@329 | 5 | return p |
paul@329 | 6 | return b |
paul@329 | 7 | |
paul@329 | 8 | f = a(2) |
paul@329 | 9 | result_2 = f() |
paul@329 | 10 | |
paul@329 | 11 | # vim: tabstop=4 expandtab shiftwidth=4 |