2009-07-19 | Paul Boddie | file changeset files shortlog | Added a CheckExtra instruction in order to support star parameters. Removed star parameter presence from the CheckFrame instruction operand. Moved the list of instructions consuming the current value to the micropython.rsvp module. Split the extra argument tests into two separate tests respectively involving known and unknown invocation targets. |
paul@256 | 1 | #!/usr/bin/env python |
paul@256 | 2 | |
paul@256 | 3 | def f(a, b, *c): |
paul@256 | 4 | return c |
paul@256 | 5 | |
paul@256 | 6 | g = f |
paul@256 | 7 | |
paul@256 | 8 | r4 = g(1, 2, 3) |
paul@256 | 9 | r5 = g(1, b=2) |
paul@256 | 10 | r6 = g(1, 2, 3, 4) |
paul@256 | 11 | |
paul@256 | 12 | def g(a, c, *b): |
paul@256 | 13 | return b |
paul@256 | 14 | |
paul@256 | 15 | r7 = g(1, c=2) |
paul@256 | 16 | r8 = g(1, 2, 3, 4) |
paul@256 | 17 | |
paul@256 | 18 | result_0 = len(r5) |
paul@256 | 19 | result_1 = len(r4) |
paul@256 | 20 | result_2 = len(r6) |
paul@256 | 21 | result2_0 = len(r7) |
paul@256 | 22 | result2_2 = len(r8) |
paul@256 | 23 | |
paul@256 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |