[New-bugs-announce] [issue8177] Incoherent error with keyword argument follow by unpacking argument lists

Ghislain Hivon report at bugs.python.org
Fri Mar 19 16:51:20 CET 2010


New submission from Ghislain Hivon <jahed_g at hotmail.com>:

Take a fonction with a parameter and  *args
def foo(bar, args*)
  pass

then call it like this
myargs = [1, 2, 3, 4, 5]
foo(bar=1, *myargs)

The call produce this error : 
TypeError: foo() got multiple values for keyword argument 'bar'

Sould the error be more like : 
SyntaxError: non-keyword arg after keyword arg

the same error if foo was called like this : 
foo(bar=1, myargs)
or
foo(bar=1, 1, 2, 3, 4, 5)

----------
components: Interpreter Core
messages: 101332
nosy: GhislainHivon
severity: normal
status: open
title: Incoherent error with  keyword argument follow by unpacking argument lists
versions: Python 2.5, Python 2.6, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8177>
_______________________________________


More information about the New-bugs-announce mailing list