2008-09-21 | Paul Boddie | file changeset files shortlog | Apply the simple case immediate assignment optimisation to attribute assignment. |
paul@59 | 1 | #!/usr/bin/env python |
paul@59 | 2 | |
paul@59 | 3 | def f(a, b, *c): |
paul@59 | 4 | pass |
paul@59 | 5 | |
paul@59 | 6 | f(1, 2, 3) |
paul@59 | 7 | f(1, b=2) |
paul@59 | 8 | f(1, 2, 3, 4) |
paul@59 | 9 | |
paul@59 | 10 | g = f |
paul@59 | 11 | g(1, 2, 3) |
paul@59 | 12 | g(1, b=2) |
paul@59 | 13 | g(1, 2, 3, 4) |
paul@59 | 14 | |
paul@59 | 15 | def g(a, c, *b): |
paul@59 | 16 | pass |
paul@59 | 17 | |
paul@59 | 18 | g(1, c=2) |
paul@59 | 19 | g(1, 2, 3, 4) |
paul@59 | 20 | |
paul@59 | 21 | # vim: tabstop=4 expandtab shiftwidth=4 |