2008-05-04 | Paul Boddie | file changeset files shortlog | Changed the _optimise_known_target method to return None where the target and context are not identified, thus producing a false value for testing. Introduced optimisation of known targets when obtaining binary operator methods. Changed constant attribute access to use LoadAddress (StoreAddress should not apply). Exposed code produced by the show function in the test program as a global. |
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 |