Python provides the ability for any function to be called with either positional or keyword [1] arguments. Here is a particularly brutal example:

    args={'a':1,'b':2,'c':3}
    def f(a,b,c): return (a,b,c)
    def g(b,c,a): return (a,b,c)
    for j in [f,g]: print j(1,2,3)
    for j in [f,g]: print j(a=1,b=2,c=3)
    for j in [f,g]: print j(*args.values())
    for j in [f,g]: print j(**args)

I see nothing in pdd 03 that provides any guidance as to how to handle this. What makes this issue so critical is that any solution will potentially affect *every* function.

- Sam Ruby

P.S. Jython handles the above test correctly. Iron-Python handles all but the **args properly.

[1] http://docs.python.org/ref/calls.html

Reply via email to