[issue8177] Incoherent error with keyword argument follow by unpacking argument lists
Ghislain Hivon
report at bugs.python.org
Sun Mar 21 22:56:17 CET 2010
Ghislain Hivon <jahed_g at hotmail.com> added the comment:
The reverse, f(*(1, 2, 3), foo=4), is consistent with
f(1,2,3, foo=4)
who also gave
TypeError: f() got multiple values for keyword argument 'foo'
Which is consistent with the tutorial
http://docs.python.org/tutorial/controlflow.html#keyword-arguments
def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):
...
but the following calls would all be invalid:
parrot(voltage=5.0, 'dead') # non-keyword argument following keyword
parrot(110, voltage=220) # duplicate value for argument
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8177>
_______________________________________
More information about the Python-bugs-list
mailing list