I was doing some testing with the different ways to pass arguments into functions and ran into what looks like a bug.<br><br>Given function,<br><br>def foo(a,b,c):<br>    print a<br>    print b<br>    print c<br><br># Call function with named parameter list, leaving 'b' out<br>
foo(a=1, c=3)<br><br>Traceback (most recent call last):<br>  File "aggregate.py", line 13, in <module><br>    foo(a=1, c=3)<br>TypeError: foo() takes exactly 3 arguments (2 given) <br><br># Call function with dictionary for parameter list... leaving 'c' out of the dictionary<br>
yarg = {'a': 111,  'b': 222}<br>foo(**yarg)<br><br>Traceback (most recent call last):<br>  File "aggregate.py", line 17, in <module><br>    foo(**yarg)<br>TypeError: foo() takes exactly 3 non-keyword arguments (2 given)<br>
<br><br># Call function with dictionary for parameter list... leaving 'b' out of the dictionary<br><br>yarg = {'a': 111,  'c': 333}<br>foo(**yarg)<br><br>Traceback (most recent call last):<br>  File "aggregate.py", line 17, in <module><br>
    foo(**yarg)<br>TypeError: foo() takes exactly 3 non-keyword arguments (1 given)<br><br>It seems like the interpreter craps out too early when you leave 'b' out of the input dictionary... and it reports the incorrect number of arguments given (I would expect to see '2 given')<br>
<br>We've tested this locally using Python 2.5, Debian Etch 32-bit installation<br><br>Thanks,<br><br>- Mark<br>