2010-06-06 | Paul Boddie | file changeset files shortlog | Introduced the notion of dynamic definitions, to be used in conjunction with the assessment of default parameter values, in order to determine whether functions (and lambdas) are dynamic. Fixed default layout for static and dynamic functions, removing lambda-specific tests. Changed the result of function/lambda definitions during inspection to be a genuine function which can then be tested for dynamic properties. Fixed loop tracking within functions. |
paul@331 | 1 | #!/usr/bin/env python |
paul@331 | 2 | |
paul@331 | 3 | d = 4 |
paul@331 | 4 | |
paul@331 | 5 | i = 0 |
paul@331 | 6 | l = [] |
paul@331 | 7 | |
paul@331 | 8 | while i < 3: |
paul@331 | 9 | def f(a, b, c=d): |
paul@331 | 10 | return c |
paul@331 | 11 | l.append(f) |
paul@331 | 12 | i += 1 |
paul@331 | 13 | |
paul@331 | 14 | f0 = l[0] |
paul@331 | 15 | f1 = l[1] |
paul@331 | 16 | f2 = l[2] |
paul@331 | 17 | |
paul@331 | 18 | result0_3 = f0(1, 2, 3) |
paul@331 | 19 | result1_3 = f1(1, 2, 3) |
paul@331 | 20 | result2_3 = f2(1, 2, 3) |
paul@331 | 21 | result0_4 = f0(1, 2) |
paul@331 | 22 | result1_4 = f1(1, 2) |
paul@331 | 23 | result2_4 = f2(1, 2) |
paul@331 | 24 | |
paul@331 | 25 | # vim: tabstop=4 expandtab shiftwidth=4 |