2013-06-30 | Paul Boddie | file changeset files shortlog | Permit analysis of the getattr function itself, thus exposing _getattr. | syspython-as-target |
paul@408 | 1 | #!/usr/bin/env python |
paul@408 | 2 | |
paul@408 | 3 | def f(a, b, *c): |
paul@408 | 4 | d = 123 # introduce locals in the frame |
paul@408 | 5 | return c |
paul@408 | 6 | |
paul@408 | 7 | r1 = f(1, 2, 3) |
paul@408 | 8 | r2 = f(1, b=2) |
paul@408 | 9 | r3 = f(1, 2, 3, 4) |
paul@408 | 10 | |
paul@408 | 11 | result_0 = len(r2) |
paul@408 | 12 | result_1 = len(r1) |
paul@408 | 13 | result_2 = len(r3) |
paul@408 | 14 | result_3 = r1[0] |
paul@408 | 15 | result_4 = r3[1] |
paul@408 | 16 | |
paul@408 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |