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